Skip to content

Wrong handling of empty string and space values (e.g. --order-by="" or --order-by=" ") #842

@sandreas

Description

@sandreas

Information

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

Describe the bug
Providing an empty value for a string option is not possible in my test project.

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


Error: Expected an option value.

       test input.mp3 --order-by=
                                 ^ Did you forget the option value?

I would consider an empty string as a valid value. Even stranger, if I provide a space ( ) as value, it gets trimmed, although I never did that myself:

cli-tester test input.mp3 --order-by=" "
order-by=<> # no error, but no space!!?

To Reproduce

Expected behavior

  • If I provide an empty option (cli-tester test input.mp3 --order-by=""), the value should be considered as valid
  • If I provide a space as option (cli-tester test input.mp3 --order-by=" "), the given value should be preserved as is and not trimmed (I would expect that for ANY value)

Maybe I am doing something wrong?!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done 🚀

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions