jdx/usage

"usage generate completion bash" doesn't work with dashes in command name

Closed this issue · 1 comments

usage generate completion bash a-b-c --usage-cmd xxx generates a shell snippet with dashes in variable names, which doesn't work:

    if [[ -z ${_usage_spec_a-b-c:-} ]]; then
        _usage_spec_a-b-c="$(xxx)"
    fi

The variable name needs to be sanitised.

See also: https://unix.stackexchange.com/questions/23659/can-shell-variable-name-include-a-hyphen-or-dash

wow that was quick 😆
thanks!