SHTK_CLI_SET_HELP_COMMAND(3)
SHTK_CLI_SET_HELP_COMMAND(3) Library Functions Manual SHTK_CLI_SET_HELP_COMMAND(3)

shtk_cli_set_help_commandSets the interactive command to get additional help

shtk_import cli

shtk_cli_set_help_command message1 [.. messageN]

The shtk_cli_set_help_command function sets the command that a user can type to get additional help when the typed command contains a usage error. The value set by this function is used by shtk_cli_usage_error(3). The message can be provided as one or more arguments as depicted by message1 to messageN; all arguments are concatenated together into a single line.

The following could be used to point users to a GNU Info document:

main() {
    shtk_cli_set_help_command "info $(shtk_cli_progname)"
    ...
    if [ ${#} -gt 0 ]; then
        shtk_usage_error "No arguments allowed"
    fi
}

And the following could be used to tell the user to access built-in documentation:

main() {
    shtk_cli_set_help_command "$(shtk_cli_progname) --help"
    ...
    if [ ${#} -gt 0 ]; then
        shtk_usage_error "No arguments allowed"
    fi
}

shtk(3), shtk_cli(3), shtk_cli_usage_error(3)

shtk_cli_set_help_command first appeared in shtk 1.8.

July 11, 2017 Debian