Skip to content

Cannot specify negative number as command option value #587

@brentby

Description

@brentby

As of version 0.40.0, it doesn't appear possible to specify a negative number as a command option.

Assuming I define a command that takes a decimal value as a command option, and that I want to pass a negative number value, neither of the following works:

mycommand -a -1.50
mycommand -a "-1.50"

Both attempts fail with this error Not a valid name for a short option. It appears that the command option parsing logic thinks that the -1.50 is supposed to be a command option.

I would expect that the quotes at least would effectively escape the numeric value. Is this a bug, or am I missing something?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions