Skip to content

--lng (and any negative numeric flag) misparsed as a new flag in space-separated form #17

Description

@technicalpickles

goplaces search (and presumably other commands taking --lat/--lng) fails
when a negative coordinate is passed in space-separated form, because the flag
parser reads -71.0972 as the start of a new flag rather than as --lng's value:

$ goplaces search "coffee" --lat 42.3467 --lng -71.0972 --radius-m 1500 --min-rating 4.5 --limit 3 --no-color
Usage: goplaces search <query> [flags]

Search places by text query.

Run "goplaces search --help" for more information.

The equals form works fine:

$ goplaces search "coffee" --lat=42.3467 --lng=-71.0972 --radius-m 1500 --min-rating 4.5 --limit 3 --no-color
Results (3)
1. ...

This is surprising given the README's own example uses the space form with a
negative longitude:

goplaces search "pizza" --lat 40.8 --lng -73.9 --radius-m 3000

which will fail identically if run as documented. Any western-hemisphere
longitude (or southern-hemisphere latitude) hits this.

Version: v0.4.3 (linux/arm64, built from the published release tarball)

Would be great if either (a) the flag parser special-cased negative numbers
after a flag expecting one (common in other CLIs), or (b) the README/help
text called out that the equals form is required for negative values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExempts this issue from stale automation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions