package
0.0.0-20250102010652-32484aa8349e
Repository: https://github.com/saylorsolutions/x.git
Documentation: pkg.go.dev
# Functions
AddGlobalPreExec registers a function that will be executed right before a [Command] runs.
MapArgs is an easy way to map arguments to variables (targets), and require a certain amount.
MustGet is used with a [pflag.FlagSet] getter to panic if the flag is not defined, or is not the right type.
NewCommandSet is used to set up a top level [CommandSet] as the root of a CLI's command structure.
No description provided by the author
NewUsageError is used to create a [UsageError].
# Constants
This is used in interactive mode to indicate that the last element on the invocation stack should be popped.
This is used in interactive mode to indicate that a set of sub-commands should be pushed to the invocation stack.
# Variables
No description provided by the author
No description provided by the author
HelpPatterns is a slice of flags that should trigger the output of usage information with the top-level [CommandSet].
InteractiveFlag specifies the flag that the user should pass to trigger [CommandSet.RespondInteractive].
InteractiveQuitCommands is a slice of strings that should escape from interactive mode.
# Structs
Command is an executable function in a CLI.
CommandSet is a group of [Command].
Printer is provided to easily establish policies for user messages.
UsageError is a special purpose error used to signal that usage information should be shown to the user.
# Type aliases
CommandFunc is a function that may be executed within a [Command].
PreExec is a function that may run before execution of a [Command].