Skip to content

question/help - how to parse to display help (-h) message if there is zero option #28

Closed Answered by ko1nksm
geneliu asked this question in Q&A
Discussion options

You must be logged in to vote

Simply call the usage function.

...
else
    echo "here!"
    ## How to let the command to display the help message here the same as --help option??
    usage
fi
...
parser_definition() {
        setup   REST help:usage abbr:true -- \
                "Usage: ${2##*/} [global options...] [command] [options...] [arguments...]"
...

The help:usagedefines a function named usage.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@geneliu
Comment options

Answer selected by ko1nksm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #27 on May 25, 2021 23:46.