From 6febf5505e7f81a5a6e04e5f608b556a31d0eb1b Mon Sep 17 00:00:00 2001 From: Naveen Gogineni Date: Sun, 25 Sep 2022 12:03:23 -0400 Subject: [PATCH] Fix docs --- testdata/godoc-v2.x.txt | 46 ++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/testdata/godoc-v2.x.txt b/testdata/godoc-v2.x.txt index 3d5cb9a298..6703de355a 100644 --- a/testdata/godoc-v2.x.txt +++ b/testdata/godoc-v2.x.txt @@ -148,7 +148,7 @@ var SubcommandHelpTemplate = `NAME: {{.HelpName}} - {{.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: {{wrap .Description 3}}{{end}} @@ -361,10 +361,6 @@ func (a *App) RunAndExitOnError() to cli.App.Run. This will cause the application to exit with the given error 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) 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 @@ -458,6 +454,8 @@ type BoolFlag struct { EnvVars []string Count *int + + Action func(*Context, bool) error } BoolFlag is a flag with type bool @@ -570,6 +568,8 @@ type Command struct { } Command is a subcommand for a cli.App. +func (cmd *Command) Command(name string) *Command + func (c *Command) FullName() string FullName returns the full name of the command. For subcommands this ensures that parent commands are part of the command path @@ -580,9 +580,7 @@ func (c *Command) HasName(name string) bool func (c *Command) Names() []string Names returns the names including short names and aliases. -func (c *Command) Run(ctx *Context) (err error) - Run invokes the command given the context, parses ctx.Args() to generate - command-specific flags +func (c *Command) Run(cCtx *Context, arguments []string) (err error) func (c *Command) VisibleCategories() []CommandCategory VisibleCategories returns a slice of categories and commands that are @@ -776,6 +774,8 @@ type DurationFlag struct { Aliases []string EnvVars []string + + Action func(*Context, time.Duration) error } DurationFlag is a flag with type time.Duration @@ -952,6 +952,8 @@ type Float64Flag struct { Aliases []string EnvVars []string + + Action func(*Context, float64) error } Float64Flag is a flag with type float64 @@ -1038,6 +1040,8 @@ type Float64SliceFlag struct { Aliases []string EnvVars []string + + Action func(*Context, []float64) error } Float64SliceFlag is a flag with type *Float64Slice @@ -1115,6 +1119,8 @@ type GenericFlag struct { EnvVars []string TakesFile bool + + Action func(*Context, interface{}) error } GenericFlag is a flag with type Generic @@ -1181,6 +1187,8 @@ type Int64Flag struct { EnvVars []string Base int + + Action func(*Context, int64) error } Int64Flag is a flag with type int64 @@ -1267,6 +1275,8 @@ type Int64SliceFlag struct { Aliases []string EnvVars []string + + Action func(*Context, []int64) error } Int64SliceFlag is a flag with type *Int64Slice @@ -1338,6 +1348,8 @@ type IntFlag struct { EnvVars []string Base int + + Action func(*Context, int) error } IntFlag is a flag with type int @@ -1428,6 +1440,8 @@ type IntSliceFlag struct { Aliases []string EnvVars []string + + Action func(*Context, []int) error } IntSliceFlag is a flag with type *IntSlice @@ -1533,6 +1547,8 @@ type PathFlag struct { EnvVars []string TakesFile bool + + Action func(*Context, Path) error } PathFlag is a flag with type Path @@ -1673,6 +1689,8 @@ type StringFlag struct { EnvVars []string TakesFile bool + + Action func(*Context, string) error } StringFlag is a flag with type string @@ -1761,6 +1779,8 @@ type StringSliceFlag struct { EnvVars []string TakesFile bool + + Action func(*Context, []string) error } StringSliceFlag is a flag with type *StringSlice @@ -1867,6 +1887,8 @@ type TimestampFlag struct { Layout string Timezone *time.Location + + Action func(*Context, *time.Time) error } TimestampFlag is a flag with type *Timestamp @@ -1932,6 +1954,8 @@ type Uint64Flag struct { EnvVars []string Base int + + Action func(*Context, uint64) error } Uint64Flag is a flag with type uint64 @@ -2018,6 +2042,8 @@ type Uint64SliceFlag struct { Aliases []string EnvVars []string + + Action func(*Context, []uint64) error } Uint64SliceFlag is a flag with type *Uint64Slice @@ -2080,6 +2106,8 @@ type UintFlag struct { EnvVars []string Base int + + Action func(*Context, uint) error } UintFlag is a flag with type uint @@ -2170,6 +2198,8 @@ type UintSliceFlag struct { Aliases []string EnvVars []string + + Action func(*Context, []uint) error } UintSliceFlag is a flag with type *UintSlice