steve8x8 / geotoad

Geocaching query tool written in Ruby
https://buymeacoffee.com/steve8x8
Other
28 stars 8 forks source link

Problem with negative latitude in command line #331

Closed elfnor closed 8 years ago

elfnor commented 8 years ago

Negative latitude gives the following error:

>>>./geotoad.rb -u user -p password -q coord "-45.923, 170.200"  -y1.00km
...
./geotoad.rb: invalid option -- 4
ERROR: Error in option parsing: invalid option -- 4 - this may be a bug, please check and report.

The following works:

>>>./geotoad.rb -u user -p password -q coord "S45.923, E170.200"  -y1.00km
steve8x8 commented 8 years ago

Citing the manual page:

SYNOPSIS
       geotoad
              will invoke text user interface (TUI)

       geotoad [options] [--] <search>
              (command-line version)
[...]
SPECIAL CASES
   Minus signs:
       If your search item(s) (according to the queryType) start with  a  dash
       (minus  sign),  it has to be "hidden" from the option parser.  This, in
       Unix tradition, is done by inserting a "double  dash"  --  between  the
       last option and the search argument(s).

Search arguments therefore should be listed after all options (I know that the parser isn't that strict but it's still recommended), and if necessary separated by a double-dash. This is common behaviour of Unix command line parsers. Note that it is NOT required to list the search arguments immediately after the search type option.

I will close this bug report when the next version has been released.