-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allowed values of optional flags and arguments fail when set -u
mode is set
#445
Comments
set -u
mode is set.set -u
mode is set
Confirmed, thank you for the easily reproducible report. I was sure that all tests (and examples) are tested under the My plan is:
BTW - you should use lowercase when naming args ( |
This is fixed now in master branch, and in the edge docker image. I will hold off on releasing for a day or two, allowing you some time to test it if you can. |
Thank you for the quick response, I will check it this evening. |
I have tested the docker and the issue seems to be fixed with args as well as with flags. By the way, I use podman instead of docker, and I had to add alias bashly='docker run --rm -it --user $(id -u):$(id -g) --volume "$PWD:/app:U" docker.io/dannyben/bashly' (Another difference is the |
Alright, thanks for confirming. |
This is now fixed in version 1.1.2. |
Bashly Version
Latest Ruby Gem
Description
I have a command with optional arguments and flags. Only some values are allowed and none of the flags or arguments are required. However, when no value is passed, the script fails with
unbound variable
error.The check for the allowed values is done like this:
This fails with
unbound variable
error if the argument or the flag are not set:The
:command.whitelist_filter
should use[[ -n ${args['arg']:-} ]]
instead of[[ -n ${args['arg']} ]]
to check the default values.Contents of bashly.yml
Reproduction Steps
Actual Behavior
Expected Behavior
No error should be shown, because the argument (or flag) are not required.
The text was updated successfully, but these errors were encountered: