Expand description
Help and version printing helpers for CLI entry points. Help and version printing helpers for CLI tools.
Provides two diverging functions that print to stdout and exit:
print_help(text: &str) -> !— colorize and print a help string, then exit 0print_version(version_str: &str) -> !— print a version string, then exit 0
Both functions are intended to be called from argument parsing code when
-h/--help or --version flags are detected.
Functions§
- print_
help - Colorize
textwith a left-to-right rainbow spanning the current terminal width, print it to stdout, and exit with code 0. - print_
version - Print
version_strto stdout and exit with code 0.