matejak / argbash

Bash argument parsing code generator
Other
1.39k stars 63 forks source link

ARG_OPTIONAL_BOOLEAN no need to generate the --no-xxx by default #151

Open Gcaufy opened 3 years ago

Gcaufy commented 3 years ago

Ref: https://github.com/matejak/argbash/issues/14

For example, I have a --yes option.

# ARG_OPTIONAL_BOOLEAN([yes],[y],[Delete action without confirm again])

It generated like this:

The general script's help msg
Usage: /tmp/test.sh [-y|--(no-)yes] [-h|--help]
    -y, --yes, --no-yes: Delete local branches without confirm (off by default)
    -h, --help: Prints help

--no-yes make no sense. and it's totally unnecessary to generate the --no-xxxx option, because the value is off by default.

matejak commented 1 year ago

I agree.