SHTK_CLI_ERROR(3)

πŸ“¦ version 1.7, in nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, welcome to the SHTK_CLI_ERROR(3) page β€” it’s serving Library Functions Manual energy, and it’s all about shtk_cli_error, the function that prints a runtime error message and exits. Very β€œwe are ending this script with receipts” of it. πŸ’…

πŸŽ€ LIBRARY πŸŽ€

You get this one by importing the CLI library: shtk_import cli.

✨ SYNOPSIS ✨

shtk_cli_error message1 [.. messageN]

πŸ¦‹ DESCRIPTION πŸ¦‹

The function shtk_cli_error prints the given runtime error message to stderr and then terminates execution of the script with a return value of 1. It is literally the bail-out button. 😭

The message can be handed over as one or more arguments β€” that’s the message1 to messageN situation β€” and all arguments are concatenated together into a single line. So yes bestie, you can pass multiple pieces and they get smushed into one line. 🫢

The printed message has this exact form, where progname is determined by shtk_cli_progname(3):

progname: E: message1 .. messageN

Use shtk_cli_error when you need to bail out on erroneous conditions that are not directly caused by an invalid invocation of the script. For errors caused directly by the user β€” like specifying an incorrect flag to the program β€” report them with shtk_cli_usage_error(3). That’s the vibe check: wrong user flag goes to usage error, other runtime oops goes here. πŸ’€

🌈 SEE ALSO 🌈

πŸ‘‘ HISTORY πŸ‘‘

shtk_cli_error first appeared in shtk 1.0. Iconic. ⭐


okay that’s the whole page, bestie β€” the footer says Debian and November 5, 2014, so that’s the source/version + date tea. mwah πŸ’‹

πŸ“¦ where this page comes from