$cmd_tempdir
Path to temporary directory for this command instance.
$error_usage_hook
Set to cmd_error_usage() to provide command usage.
cmd_cleanup_tempdir()
Removes the command's temporary directory: $cmd_tempdir.
cmd_tempfile()
Creates a temporary file in $cmd_tempdir, printing its name to stdout. All of these files will be deleted when the script terminates. See cmd_cleanup_tempdir() for more information.
cmd_name()
Prints a command name, given ${script[@]} and $@.
cmd_exists()
Returns success if a named command function exists.
$@ - Command names to pass to cmd_name().
cmd_run()
Executes the current command with the given arguments ($@)
cmd_dispatch_builtins()
Attempts to dispatch a built-in command ($1). Returns success if the given command was handled.
TODO: Extend this mechanism to allow registering new commands
cmd_dispatch()
Dispatches a command ($1) and moves to that command's namespace. Where used, this function effectively creates the script's command language heirarchy. Recursive calls extend the ${script[@]} array, so each successive call operates on a new nested namespace.
$1 - Command name
$@ - Command arguments
cmd_exec()
Executes a command ($1) in the current namespace.
$1 - Command name
$@ - Command arguments
cmd_exec_something()
Executes a command ($1) in the first ancenstor namespace that contains it. The search begins in current command namespace and ascends up to the script namespace. Once a command handler has been found, that function will be executed and control returned to the caller.
cmd_usage()
Prints usage information for the current command. To be user-friendly, searchs for usage in anscestor command namespaces. This allows commands to defer their usage information to their parent commands.
cmd_help()
Prints help text for the current command. This function operates according to the same principles as cmd_usage().
cmd_error_usage()
Overrides the stub from core/output library, allowing dynamic command usage lookup.