Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatBaseName ¶
FormatBaseName is formatted as an executable file name under different operating systems according to the given name.
func WordSepNormalizeFunc ¶
func WordSepNormalizeFunc(_ *pflag.FlagSet, name string) pflag.NormalizedName
WordSepNormalizeFunc changes all flags that contain "_" separators.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the main construct of a cli application. It is recommended that an app be created with the app.NewApp() function.
type CliOptions ¶
type CliOptions interface { Flags() (fss cliflag.NamedFlagSets) Validate() []error }
CliOptions abstracts configurations options for reading parameters from the command line.
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command is a sbu command structure of a cli application. It is recommended that a command be created with the app.NewCommand() function.
type Option ¶
type Option func(*App)
Option defines optional parameters for initializing the application structure.
func WithDefaultValidArgs ¶
func WithDefaultValidArgs() Option
WithDefaultValidArgs set default validation function to valid non-flag arguments.
func WithDescription ¶
WithDescription is used to set the description of the application.
func WithOptions ¶
func WithOptions(opt CliOptions) Option
WithOptions to open the application's function to read from the command line or read parameters from the configuration file.
func WithRunFunc ¶
WithRunFunc is used to set the application startup callback function option.
type RunCommandFunc ¶
RunCommandFunc defines the application's command startup callback function.