spectre.console icon indicating copy to clipboard operation
spectre.console copied to clipboard

Value starting with `-` is mistreated as extra option

Open sandreas opened this issue 3 years ago • 0 comments

Information

  • OS: Linux, Ubuntu 18.04 LTS
  • Version: 0.44
  • Terminal: xterm-256color, zsh

Describe the bug Providing a valid value starting with - throws an exception / error, when using the following syntax:

# value `-size` is short form for `size descending`
cli-tester test input.mp3 --order-by "-size"

Error: Option 'order-by' is defined but no value has been provided.

       test input.mp3 --order-by -size
                      ^^^^^^^^^^ No value provided

Using the syntax with = as value separator works like expected:

cli-tester test input.mp3 --order-by="-size"

# works like expected, prints out the unmodified option value for `--order-by`
order-by=<-size>

To Reproduce

  • Compile https://github.com/sandreas/tone/tree/main/cli-tester
  • Run the above examples

Expected behavior I would expect that option valid values with leading - would be correctly handled when NOT using = as separator, otherwise the behaviour is inconsistent in my opinion.

sandreas avatar Jul 03 '22 20:07 sandreas