-
Is there a way to add/overwrite the error handling function with usage (so it print out the help message)?
e.g.: cmd.sh -optionX will print out the default "Unrecognized option: ...". Can this be enhanced with print out as the same from cmd.sh -h (usage usually) instead? |
Beta Was this translation helpful? Give feedback.
Answered by
ko1nksm
Jul 29, 2021
Replies: 1 comment 1 reply
-
Is this what you mean? parser_definition() {
setup REST help:usage error:error
...
}
error() {
usage
return 1 # if you want to suppress the default message
} Alternative parser_definition() {
setup REST help:usage error:usage # <---
# Use `error:"usage && false"` if you want to suppress the default message
...
}
# no error handler |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
geneliu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this what you mean?
Alternative