package
2.1.3
Repository: https://github.com/gsmcwhirter/go-util.git
Documentation: pkg.go.dev

# Functions

NewCLI constructs a new Command struct that is intended to be the root command for a cli application - appName is used to name the application - buildVersion, buildDate, and buildSHA are used to construct a version string - opts determines how the command behaves.
NewCommand constructs a new Command struct that can be used as a subcommand - cmdName is the name of the command - opts determines how the command behaves.

# Variables

ExactArgs is a possible CommandOptions.Args value that indicates an exact number N of positional arguments is required Pass as CommandOptions.Args = ExactArgs(3) for exactly 3 args.
MaximumNArgs is a possible CommandOpitions.Args value that indicates at most N positional arguments are allowed Pass as CommandOptions.Args = MaximumNArgs(3) for at most 3 args.
MinimumNArgs is a possible CommandOptions.Args value that indicates at least N positional arguments are required Pass as CommandOptions.Args = MinimumNArgs(3) for at least 3 args.
NoArgs is a possible CommandOptions.Args value that indicates that no positional arguments should occur Pass as CommandOptions.Args = NoArgs.
RangeArgs is a possible CommandOptions.Args vlue that indicates between M and N positional arguments are required Pass as CommandOptions.Args = RangeArgs(3, 5) for at least 3 and at most 5 args.

# Structs

Command is a thin wrapper around a cobra.Command pointer to provide some convenience functions.
CommandOptions is a way to specify the structure of a cli command - ShortHelp is the short description of the command (should be one line) - LongHelp is a longer description of the command - Example is a string containing examples (can also be constructed and expanded with Command.AddExamples) - PosArgsUsage is a string to represent the positional arguments expected - Deprecated is a string that will be displayed to indicate the command is deprecated - Args is a specifier for the number of positional arguments (see NoArgs, ExactArgs, MinimumNArgs, MaximumNArgs, RangeArgs) - Aliases is a list of aliases for the command - Hidden enables hiding the command from help messages - SilenceUsage will prevent a usage message from being displayed if an error occurs.