google/argh

Single dash is parsed as unrecognized argument

alyssais opened this issue · 1 comments

According to the Fuchsia command line rubric, and general Unix practice, a single dash is not allowed as a key or switch, but that's how argh treats it, because it doesn't have a special case for it like it does for --.

if next_arg.starts_with('-') && !options_ended {

This means that to pass a single dash as a positional argument, you have to pass -- -, which is very unintuitive.

Fuchsia’s Command-line Tools Rubric states:

A single dash ('-') on its own is reserved for future use.

As such, it would be incorrect to treat it as a positional argument. However, a dedicated error message could improve upon the current Unrecognized argument: -.