-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Usage message should reflect when a set of accepted values is restricted. #76
Comments
Take a look at argbash guide, and check out the |
ok so I'm trying to do this.
|
since argbash doesn't show the list of valid options in help, I have to try a workaround. |
If I change the declaration to
It works, but then I have to redeclare the same options multiple times (one for building the help text, and again to show the valid options).
|
Yes, you are doing it right. The code generator can't have access to bash variables, so you have to repeat it for the help message text. |
When there are args of the on-of type, the help message and docopt output inform the user accordingly. Fixes: #76
When there are args of the on-of type, the help message and docopt output inform the user accordingly. Fixes: #76
Is there a way to provide a list of valid positional values?
I want my script to accept a single positional argument where the command has a specific list of valid commands that it accepts? Say the list is: start, stop, deploy, remove
if a user tries to enter a command such as 'foo' then the help comes up and says the command is not a valid command, here is the list and each command's description and help.
./my_script.sh
./my_script.sh deploy
./my_script.sh stop
./my_script.sh start
./my_script.sh foo
this one fails and says that foo isn't a valid command, and provides a list of valid commands to pass and their help (description).
The text was updated successfully, but these errors were encountered: