usage fish
- Usage:
usage fish [-h] [--help] <SCRIPT> [ARGS]… - Source code:
cli/src/cli/shell.rs
Run a script whose usage spec is written in its own comments
Usually reached through the script's shebang: the kernel hands the script and its arguments to usage, which parses them against the #USAGE lines at the top of the file, then runs the script with this shell. Each flag and argument reaches the script as an environment variable named usage_<name>, so --force becomes usage_force and <file> becomes usage_file. A value declared var=#true arrives as one string, joined with shell_words::join() so that an element containing a space stays quoted.
-h and --help print the script's help page rather than this one.
This command's shebang is #!/usr/bin/env -S usage fish, and the program it runs is fish from PATH. USAGECLI_SHELL_FISH names a different one.
Arguments
<SCRIPT>— The script to run; its spec is read from the#USAGEcomments at the top of the file[ARGS]…— Arguments to pass to the scriptAnything
usagedoes not recognise is a value rather than a mistake, which is what lets a shebang script take flags of its own.
Flags
-h— Print the script's help page instead of running it--help— Print the script's help page instead of running it