SHTK_CLI_USAGE_ERROR(3)
SHTK_CLI_USAGE_ERROR(3) Library Functions Manual SHTK_CLI_USAGE_ERROR(3)

shtk_cli_usage_errorPrints a usage error and exits

shtk_import cli

shtk_cli_usage_error message1 [.. messageN]

The shtk_cli_usage_error function prints the given usage error message to stderr and terminates execution of the script with a return value of 1. 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 printed message has the following form, where ‘progname’ is determined by shtk_cli_progname(3):

progname: E: message1 .. messageN
Type 'man progname' for help.

shtk_cli_usage_error should be used to inform the user of problems directly caused by his invocation of the script (e.g. the use of an invalid flag).

By default, the printed error message refers to a manual page for the script. You should have one, but if you don't, you can use the shtk_cli_set_help_command(3) function early on in your script to customize the command shown to the user.

shtk(3), shtk_cli(3), shtk_cli_set_help_command(3)

shtk_cli_usage_error first appeared in shtk 1.0.

July 11, 2017 Debian