This commit is contained in:
Naveen Gogineni 2022-09-25 12:03:23 -04:00
parent 2576c0ce4e
commit 00ef229486

View File

@ -136,7 +136,7 @@ var SubcommandHelpTemplate = `NAME:
{{template "helpNameTemplate" .}} {{template "helpNameTemplate" .}}
USAGE: USAGE:
{{if .UsageText}}{{wrap .UsageText 3}}{{else}}{{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Description}} {{if .UsageText}}{{wrap .UsageText 3}}{{else}}{{.HelpName}} {{if .VisibleFlags}}command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Description}}
DESCRIPTION: DESCRIPTION:
{{template "descriptionTemplate" .}}{{end}}{{if .VisibleCommands}} {{template "descriptionTemplate" .}}{{end}}{{if .VisibleCommands}}
@ -347,10 +347,6 @@ func (a *App) RunAndExitOnError()
to cli.App.Run. This will cause the application to exit with the given error to cli.App.Run. This will cause the application to exit with the given error
code in the cli.ExitCoder code in the cli.ExitCoder
func (a *App) RunAsSubcommand(ctx *Context) (err error)
RunAsSubcommand invokes the subcommand given the context, parses ctx.Args()
to generate command-specific flags
func (a *App) RunContext(ctx context.Context, arguments []string) (err error) func (a *App) RunContext(ctx context.Context, arguments []string) (err error)
RunContext is like Run except it takes a Context that will be passed to RunContext is like Run except it takes a Context that will be passed to
its commands and sub-commands. Through this, you can propagate timeouts and its commands and sub-commands. Through this, you can propagate timeouts and
@ -557,6 +553,8 @@ type Command struct {
} }
Command is a subcommand for a cli.App. Command is a subcommand for a cli.App.
func (cmd *Command) Command(name string) *Command
func (c *Command) FullName() string func (c *Command) FullName() string
FullName returns the full name of the command. For subcommands this ensures FullName returns the full name of the command. For subcommands this ensures
that parent commands are part of the command path that parent commands are part of the command path
@ -567,9 +565,7 @@ func (c *Command) HasName(name string) bool
func (c *Command) Names() []string func (c *Command) Names() []string
Names returns the names including short names and aliases. Names returns the names including short names and aliases.
func (c *Command) Run(ctx *Context) (err error) func (c *Command) Run(cCtx *Context, arguments []string) (err error)
Run invokes the command given the context, parses ctx.Args() to generate
command-specific flags
func (c *Command) VisibleCommands() []*Command func (c *Command) VisibleCommands() []*Command
VisibleCommands returns a slice of the Commands with Hidden=false VisibleCommands returns a slice of the Commands with Hidden=false