Repository: urfave/cli
Pull request #1605 (2022-11-30 12:56:51)

Fix comment about helpCommand Action
<!--
  This template provides some ideas of things to include in your PR description.
  To start, try providing a short summary of your changes in the Title above.
  If a section of the PR template does not apply to this PR, then delete that section.
 -->

## What type of PR is this?

- documentation

## What this PR does / why we need it:
Corrected comment about `helpAction`.

## Which issue(s) this PR fixes:
none

## Release Notes
none



Patch:
diff --git a/app.go b/app.go
index 51b2672..a6c1976 100644
--- a/app.go
+++ b/app.go
@@ -265,7 +265,7 @@ func (a *App) newRootCommand() *Command {
 		After:                  a.After,
 		Action:                 a.Action,
 		OnUsageError:           a.OnUsageError,
-		Commands:               a.Commands,
+		Subcommands:            a.Commands,
 		Flags:                  a.Flags,
 		flagCategories:         a.flagCategories,
 		HideHelp:               a.HideHelp,
diff --git a/command.go b/command.go
index bf9ce01..f648b92 100644
--- a/command.go
+++ b/command.go
@@ -37,7 +37,7 @@ type Command struct {
 	// Execute this function if a usage error occurs.
 	OnUsageError OnUsageErrorFunc
 	// List of child commands
-	Commands []*Command
+	Subcommands []*Command
 	// List of flags to parse
 	Flags          []Flag
 	flagCategories FlagCategories
@@ -97,7 +97,7 @@ func (c *Command) FullName() string {
 }
 
 func (cmd *Command) Command(name string) *Command {
-	for _, c := range cmd.Commands {
+	for _, c := range cmd.Subcommands {
 		if c.HasName(name) {
 			return c
 		}
@@ -110,7 +110,7 @@ func (c *Command) setup(ctx *Context) {
 	if c.Command(helpCommand.Name) == nil && !c.HideHelp {
 		if !c.HideHelpCommand {
 			helpCommand.HelpName = fmt.Sprintf("%s %s", c.HelpName, helpName)
-			c.Commands = append(c.Commands, helpCommand)
+			c.Subcommands = append(c.Subcommands, helpCommand)
 		}
 	}
 
@@ -124,19 +124,19 @@ func (c *Command) setup(ctx *Context) {
 	}
 
 	c.categories = newCommandCategories()
-	for _, command := range c.Commands {
+	for _, command := range c.Subcommands {
 		c.categories.AddCommand(command.Category, command)
 	}
 	sort.Sort(c.categories.(*commandCategories))
 
 	var newCmds []*Command
-	for _, scmd := range c.Commands {
+	for _, scmd := range c.Subcommands {
 		if scmd.HelpName == "" {
 			scmd.HelpName = fmt.Sprintf("%s %s", c.HelpName, scmd.Name)
 		}
 		newCmds = append(newCmds, scmd)
 	}
-	c.Commands = newCmds
+	c.Subcommands = newCmds
 }
 
 func (c *Command) Run(cCtx *Context, arguments ...string) (err error) {
@@ -237,8 +237,8 @@ func (c *Command) Run(cCtx *Context, arguments ...string) (err error) {
 
 			if hasDefault {
 				dc := cCtx.App.Command(cCtx.App.DefaultCommand)
-				defaultHasSubcommands = len(dc.Commands) > 0
-				for _, dcSub := range dc.Commands {
+				defaultHasSubcommands = len(dc.Subcommands) > 0
+				for _, dcSub := range dc.Subcommands {
 					if checkStringSliceIncludes(name, dcSub.Names()) {
 						isDefaultSubcommand = true
 						break
@@ -395,7 +395,7 @@ func (c *Command) VisibleCategories() []CommandCategory {
 // VisibleCommands returns a slice of the Commands with Hidden=false
 func (c *Command) VisibleCommands() []*Command {
 	var ret []*Command
-	for _, command := range c.Commands {
+	for _, command := range c.Subcommands {
 		if !command.Hidden {
 			ret = append(ret, command)
 		}
diff --git a/docs.go b/docs.go
index 45a0bc3..8b1c9c8 100644
--- a/docs.go
+++ b/docs.go
@@ -91,10 +91,10 @@ func prepareCommands(commands []*Command, level int) []string {
 		coms = append(coms, prepared)
 
 		// recursively iterate subcommands
-		if len(command.Commands) > 0 {
+		if len(command.Subcommands) > 0 {
 			coms = append(
 				coms,
-				prepareCommands(command.Commands, level+1)...,
+				prepareCommands(command.Subcommands, level+1)...,
 			)
 		}
 	}
diff --git a/fish.go b/fish.go
index 99fd9a2..222792f 100644
--- a/fish.go
+++ b/fish.go
@@ -99,11 +99,11 @@ func (a *App) prepareFishCommands(commands []*Command, allCommands *[]string, pr
 		)
 
 		// recursively iterate subcommands
-		if len(command.Commands) > 0 {
+		if len(command.Subcommands) > 0 {
 			completions = append(
 				completions,
 				a.prepareFishCommands(
-					command.Commands, allCommands, command.Names(),
+					command.Subcommands, allCommands, command.Names(),
 				)...,
 			)
 		}
diff --git a/flag.go b/flag.go
index e4357f3..6754863 100644
--- a/flag.go
+++ b/flag.go
@@ -378,17 +378,17 @@ func hasFlag(flags []Flag, fl Flag) bool {
 // Return the first value from a list of environment variables and files
 // (which may or may not exist), a description of where the value was found,
 // and a boolean which is true if a value was found.
-func flagFromEnvOrFile(envVars []string, filePaths []string) (value string, fromWhere string, found bool) {
+func flagFromEnvOrFile(envVars []string, filePath string) (value string, fromWhere string, found bool) {
 	for _, envVar := range envVars {
 		envVar = strings.TrimSpace(envVar)
 		if value, found := syscall.Getenv(envVar); found {
 			return value, fmt.Sprintf("environment variable %q", envVar), true
 		}
 	}
-	for _, fileVar := range filePaths {
+	for _, fileVar := range strings.Split(filePath, ",") {
 		if fileVar != "" {
 			if data, err := os.ReadFile(fileVar); err == nil {
-				return string(data), fmt.Sprintf("file %q", filePaths), true
+				return string(data), fmt.Sprintf("file %q", filePath), true
 			}
 		}
 	}
diff --git a/flag_impl.go b/flag_impl.go
index 18566fa..cd3d3a5 100644
--- a/flag_impl.go
+++ b/flag_impl.go
@@ -36,10 +36,10 @@ type NoConfig struct{}
 type FlagBase[T any, C any, VC ValueCreator[T, C]] struct {
 	Name string // name of the flag
 
-	Category    string   // category of the flag, if any
-	DefaultText string   // default text of the flag for usage purposes
-	FilePaths   []string // file paths to load value from
-	Usage       string   // usage string for help output
+	Category    string // category of the flag, if any
+	DefaultText string // default text of the flag for usage purposes
+	FilePath    string // file path to load value from
+	Usage       string // usage string for help output
 
 	Required   bool // whether the flag is required or not
 	Hidden     bool // whether to hide the flag in help output
@@ -84,7 +84,7 @@ func (f *FlagBase[T, C, V]) Apply(set *flag.FlagSet) error {
 	if !f.applied || !f.Persistent {
 		newVal := f.Value
 
-		if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePaths); found {
+		if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
 			tmpVal := f.creator.Create(f.Value, new(T), f.Config)
 			if val != "" || reflect.TypeOf(f.Value).Kind() == reflect.String {
 				if err := tmpVal.Set(val); err != nil {
diff --git a/godoc-current.txt b/godoc-current.txt
index d047329..4f426b7 100644
--- a/godoc-current.txt
+++ b/godoc-current.txt
@@ -483,7 +483,7 @@ type Command struct {
 	// Execute this function if a usage error occurs.
 	OnUsageError OnUsageErrorFunc
 	// List of child commands
-	Commands []*Command
+	Subcommands []*Command
 	// List of flags to parse
 	Flags []Flag
 
@@ -775,10 +775,10 @@ var VersionFlag Flag = &BoolFlag{
 type FlagBase[T any, C any, VC ValueCreator[T, C]] struct {
 	Name string // name of the flag
 
-	Category    string   // category of the flag, if any
-	DefaultText string   // default text of the flag for usage purposes
-	FilePaths   []string // file paths to load value from
-	Usage       string   // usage string for help output
+	Category    string // category of the flag, if any
+	DefaultText string // default text of the flag for usage purposes
+	FilePath    string // file path to load value from
+	Usage       string // usage string for help output
 
 	Required   bool // whether the flag is required or not
 	Hidden     bool // whether to hide the flag in help output
diff --git a/help.go b/help.go
index b29b89e..74f232d 100644
--- a/help.go
+++ b/help.go
@@ -55,7 +55,7 @@ var helpCommand = &Command{
 			cCtx = cCtx.parentContext
 		}
 
-		// Case 4. $ app hello foo
+		// Case 4. $ app help foo
 		// foo is the command for which help needs to be shown
 		if argsPresent {
 			return ShowCommandHelp(cCtx, firstArg)
@@ -70,8 +70,8 @@ var helpCommand = &Command{
 		}
 
 		// Case 3, 5
-		if (len(cCtx.Command.Commands) == 1 && !cCtx.Command.HideHelp) ||
-			(len(cCtx.Command.Commands) == 0 && cCtx.Command.HideHelp) {
+		if (len(cCtx.Command.Subcommands) == 1 && !cCtx.Command.HideHelp) ||
+			(len(cCtx.Command.Subcommands) == 0 && cCtx.Command.HideHelp) {
 			templ := cCtx.Command.CustomHelpTemplate
 			if templ == "" {
 				templ = CommandHelpTemplate
@@ -225,7 +225,7 @@ func DefaultCompleteWithFlags(cmd *Command) func(cCtx *Context) {
 		}
 
 		if cmd != nil {
-			printCommandSuggestions(cmd.Commands, cCtx.App.Writer)
+			printCommandSuggestions(cmd.Subcommands, cCtx.App.Writer)
 			return
 		}
 
@@ -242,14 +242,14 @@ func ShowCommandHelpAndExit(c *Context, command string, code int) {
 // ShowCommandHelp prints help for the given command
 func ShowCommandHelp(ctx *Context, command string) error {
 	commands := ctx.App.Commands
-	if ctx.Command.Commands != nil {
-		commands = ctx.Command.Commands
+	if ctx.Command.Subcommands != nil {
+		commands = ctx.Command.Subcommands
 	}
 	for _, c := range commands {
 		if c.HasName(command) {
 			if !c.HideHelp {
-				if !c.HideHelpCommand && len(c.Commands) != 0 && c.Command(helpName) == nil {
-					c.Commands = append(c.Commands, helpCommandDontUse)
+				if !c.HideHelpCommand && len(c.Subcommands) != 0 && c.Command(helpName) == nil {
+					c.Subcommands = append(c.Subcommands, helpCommandDontUse)
 				}
 				if HelpFlag != nil {
 					c.appendFlag(HelpFlag)
@@ -257,7 +257,7 @@ func ShowCommandHelp(ctx *Context, command string) error {
 			}
 			templ := c.CustomHelpTemplate
 			if templ == "" {
-				if len(c.Commands) == 0 {
+				if len(c.Subcommands) == 0 {
 					templ = CommandHelpTemplate
 				} else {
 					templ = SubcommandHelpTemplate
@@ -273,7 +273,7 @@ func ShowCommandHelp(ctx *Context, command string) error {
 	if ctx.App.CommandNotFound == nil {
 		errMsg := fmt.Sprintf("No help topic for '%v'", command)
 		if ctx.App.Suggest {
-			if suggestion := SuggestCommand(ctx.Command.Commands, command); suggestion != "" {
+			if suggestion := SuggestCommand(ctx.Command.Subcommands, command); suggestion != "" {
 				errMsg += ". " + suggestion
 			}
 		}


Test patch:
diff --git a/app_test.go b/app_test.go
index 330d5ca..5d2373e 100644
--- a/app_test.go
+++ b/app_test.go
@@ -64,7 +64,7 @@ func ExampleApp_Run_subcommand() {
 				Aliases:     []string{"hi"},
 				Usage:       "use it to see a description",
 				Description: "This is how we describe hello the function",
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{
 						Name:        "english",
 						Aliases:     []string{"en"},
@@ -548,7 +548,7 @@ func TestApp_RunDefaultCommandWithSubCommand(t *testing.T) {
 					{
 						Name:    "foobar",
 						Aliases: []string{"f"},
-						Commands: []*Command{
+						Subcommands: []*Command{
 							{Name: "jimbob", Aliases: []string{"j"}},
 							{Name: "carly"},
 						},
@@ -985,7 +985,7 @@ func TestApp_UseShortOptionHandlingSubCommand(t *testing.T) {
 			return nil
 		},
 	}
-	command.Commands = []*Command{subCommand}
+	command.Subcommands = []*Command{subCommand}
 	app.Commands = []*Command{command}
 
 	err := app.Run([]string{"", "cmd", "sub", "-on", expected})
@@ -1007,7 +1007,7 @@ func TestApp_UseShortOptionHandlingSubCommand_missing_value(t *testing.T) {
 			&StringFlag{Name: "name", Aliases: []string{"n"}},
 		},
 	}
-	command.Commands = []*Command{subCommand}
+	command.Subcommands = []*Command{subCommand}
 	app.Commands = []*Command{command}
 
 	err := app.Run([]string{"", "cmd", "sub", "-n"})
@@ -1204,7 +1204,7 @@ func TestApp_SetStdin_Subcommand(t *testing.T) {
 		Commands: []*Command{
 			{
 				Name: "command",
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{
 						Name: "subcommand",
 						Action: func(c *Context) error {
@@ -1524,7 +1524,7 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
 			appRunInput: []string{"myCLI", "myCommand", "mySubCommand"},
 			appCommands: []*Command{{
 				Name: "myCommand",
-				Commands: []*Command{{
+				Subcommands: []*Command{{
 					Name:  "mySubCommand",
 					Flags: []Flag{&StringFlag{Name: "requiredFlag", Required: true}},
 				}},
@@ -1550,7 +1550,7 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
 			appRunInput: []string{"myCLI", "myCommand", "mySubCommand", "--help"},
 			appCommands: []*Command{{
 				Name: "myCommand",
-				Commands: []*Command{{
+				Subcommands: []*Command{{
 					Name:  "mySubCommand",
 					Flags: []Flag{&StringFlag{Name: "requiredFlag", Required: true}},
 				}},
@@ -1577,7 +1577,7 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
 			appRunInput: []string{"myCLI", "myCommand", "mySubCommand", "--optional", "cats"},
 			appCommands: []*Command{{
 				Name: "myCommand",
-				Commands: []*Command{{
+				Subcommands: []*Command{{
 					Name:  "mySubCommand",
 					Flags: []Flag{&StringFlag{Name: "requiredFlag", Required: true}, &StringFlag{Name: "optional"}},
 				}},
@@ -1603,7 +1603,7 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
 			appRunInput: []string{"myCLI", "myCommand", "mySubCommand", "--requiredFlag", "cats"},
 			appCommands: []*Command{{
 				Name: "myCommand",
-				Commands: []*Command{{
+				Subcommands: []*Command{{
 					Name:  "mySubCommand",
 					Flags: []Flag{&StringFlag{Name: "requiredFlag", Required: true}},
 					Action: func(c *Context) error {
@@ -1868,7 +1868,7 @@ func TestApp_Run_CommandWithSubcommandHasHelpTopic(t *testing.T) {
 			cmd := &Command{
 				Name:        "foo",
 				Description: "descriptive wall of text about how it does foo things",
-				Commands:    []*Command{subCmdBar, subCmdBaz},
+				Subcommands: []*Command{subCmdBar, subCmdBaz},
 				Action:      func(c *Context) error { return nil },
 			}
 
@@ -1909,7 +1909,7 @@ func TestApp_Run_SubcommandFullPath(t *testing.T) {
 	cmd := &Command{
 		Name:        "foo",
 		Description: "foo commands",
-		Commands:    []*Command{subCmd},
+		Subcommands: []*Command{subCmd},
 	}
 	app.Commands = []*Command{cmd}
 
@@ -1943,7 +1943,7 @@ func TestApp_Run_SubcommandHelpName(t *testing.T) {
 	cmd := &Command{
 		Name:        "foo",
 		Description: "foo commands",
-		Commands:    []*Command{subCmd},
+		Subcommands: []*Command{subCmd},
 	}
 	app.Commands = []*Command{cmd}
 
@@ -1978,7 +1978,7 @@ func TestApp_Run_CommandHelpName(t *testing.T) {
 		Name:        "foo",
 		HelpName:    "custom",
 		Description: "foo commands",
-		Commands:    []*Command{subCmd},
+		Subcommands: []*Command{subCmd},
 	}
 	app.Commands = []*Command{cmd}
 
@@ -2014,7 +2014,7 @@ func TestApp_Run_CommandSubcommandHelpName(t *testing.T) {
 		Name:        "foo",
 		Usage:       "foo commands",
 		Description: "This is a description",
-		Commands:    []*Command{subCmd},
+		Subcommands: []*Command{subCmd},
 	}
 	app.Commands = []*Command{cmd}
 
@@ -2356,7 +2356,7 @@ func TestApp_Run_SubcommandDoesNotOverwriteErrorFromBefore(t *testing.T) {
 	app := &App{
 		Commands: []*Command{
 			{
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{
 						Name: "sub",
 					},
@@ -2636,7 +2636,7 @@ func TestWhenExitSubCommandWithCodeThenAppQuitUnexpectedly(t *testing.T) {
 	app.Commands = []*Command{
 		{
 			Name: "cmd",
-			Commands: []*Command{
+			Subcommands: []*Command{
 				{
 					Name: "subcmd",
 					Action: func(c *Context) error {
@@ -2737,7 +2737,7 @@ func TestFlagAction(t *testing.T) {
 				Name:   "c1",
 				Flags:  []Flag{stringFlag},
 				Action: func(ctx *Context) error { return nil },
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{
 						Name:   "sub1",
 						Action: func(ctx *Context) error { return nil },
@@ -3101,7 +3101,7 @@ func TestPersistentFlag(t *testing.T) {
 						Destination: &appOverrideCmdInt,
 					},
 				},
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{
 						Name: "subcmd",
 						Flags: []Flag{
diff --git a/command_test.go b/command_test.go
index 011ec85..10c616b 100644
--- a/command_test.go
+++ b/command_test.go
@@ -241,7 +241,7 @@ func TestCommand_OnUsageError_WithSubcommand(t *testing.T) {
 		Commands: []*Command{
 			{
 				Name: "bar",
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{
 						Name: "baz",
 					},
@@ -276,7 +276,7 @@ func TestCommand_Run_SubcommandsCanUseErrWriter(t *testing.T) {
 			{
 				Name:  "bar",
 				Usage: "this is for testing",
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{
 						Name:  "baz",
 						Usage: "this is for testing",
@@ -384,10 +384,10 @@ func TestCommand_NoVersionFlagOnCommands(t *testing.T) {
 		Version: "some version",
 		Commands: []*Command{
 			{
-				Name:     "bar",
-				Usage:    "this is for testing",
-				Commands: []*Command{{}}, // some subcommand
-				HideHelp: true,
+				Name:        "bar",
+				Usage:       "this is for testing",
+				Subcommands: []*Command{{}}, // some subcommand
+				HideHelp:    true,
 				Action: func(c *Context) error {
 					if len(c.Command.VisibleFlags()) != 0 {
 						t.Fatal("unexpected flag on command")
@@ -408,9 +408,9 @@ func TestCommand_CanAddVFlagOnCommands(t *testing.T) {
 		Writer:  io.Discard,
 		Commands: []*Command{
 			{
-				Name:     "bar",
-				Usage:    "this is for testing",
-				Commands: []*Command{{}}, // some subcommand
+				Name:        "bar",
+				Usage:       "this is for testing",
+				Subcommands: []*Command{{}}, // some subcommand
 				Flags: []Flag{
 					&BoolFlag{
 						Name: "v",
@@ -436,7 +436,7 @@ func TestCommand_VisibleSubcCommands(t *testing.T) {
 	c := &Command{
 		Name:  "bar",
 		Usage: "this is for testing",
-		Commands: []*Command{
+		Subcommands: []*Command{
 			subc1,
 			{
 				Name:   "subc2",
@@ -496,9 +496,9 @@ func TestCommand_RunSubcommandWithDefault(t *testing.T) {
 				},
 			},
 			{
-				Name:     "bar",
-				Usage:    "this is for testing",
-				Commands: []*Command{{}}, // some subcommand
+				Name:        "bar",
+				Usage:       "this is for testing",
+				Subcommands: []*Command{{}}, // some subcommand
 				Action: func(*Context) error {
 					return nil
 				},
diff --git a/context_test.go b/context_test.go
index 3502835..d7476a1 100644
--- a/context_test.go
+++ b/context_test.go
@@ -148,7 +148,7 @@ func TestContext_Value_InvalidFlagAccessHandler(t *testing.T) {
 		Commands: []*Command{
 			{
 				Name: "command",
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{
 						Name: "subcommand",
 						Action: func(ctx *Context) error {
diff --git a/fish_test.go b/fish_test.go
index 10a0a16..dcc618f 100644
--- a/fish_test.go
+++ b/fish_test.go
@@ -60,7 +60,7 @@ func testApp() *App {
 		},
 		Name:  "config",
 		Usage: "another usage test",
-		Commands: []*Command{{
+		Subcommands: []*Command{{
 			Aliases: []string{"s", "ss"},
 			Flags: []Flag{
 				&StringFlag{Name: "sub-flag", Aliases: []string{"sub-fl", "s"}},
@@ -110,7 +110,7 @@ func() { ... }
 
 Should be a part of the same code block
 `,
-		Commands: []*Command{{
+		Subcommands: []*Command{{
 			Aliases: []string{"su"},
 			Flags: []Flag{
 				&BoolFlag{
diff --git a/flag_test.go b/flag_test.go
index 9bee920..95e3bd9 100644
--- a/flag_test.go
+++ b/flag_test.go
@@ -2565,7 +2565,7 @@ func TestFlagFromFile(t *testing.T) {
 	}
 
 	for _, filePathTest := range filePathTests {
-		got, _, _ := flagFromEnvOrFile(filePathTest.name, []string{filePathTest.path})
+		got, _, _ := flagFromEnvOrFile(filePathTest.name, filePathTest.path)
 		if want := filePathTest.expected; got != want {
 			t.Errorf("Did not expect %v - Want %v", got, want)
 		}
diff --git a/help_test.go b/help_test.go
index d7299df..2d44cf4 100644
--- a/help_test.go
+++ b/help_test.go
@@ -221,8 +221,8 @@ func Test_helpCommand_HelpName(t *testing.T) {
 				Name: "app",
 				Commands: []*Command{
 					{
-						Name:     "cmd",
-						Commands: []*Command{{Name: "subcmd"}},
+						Name:        "cmd",
+						Subcommands: []*Command{{Name: "subcmd"}},
 					},
 				},
 				Writer: buf,
@@ -357,7 +357,7 @@ func TestShowCommandHelp_AppendHelp(t *testing.T) {
 						HideHelp:        tt.hideHelp,
 						HideHelpCommand: tt.hideHelpCommand,
 						Action:          func(ctx *Context) error { return ShowCommandHelp(ctx, "subcmd") },
-						Commands:        []*Command{{Name: "subcmd"}},
+						Subcommands:     []*Command{{Name: "subcmd"}},
 					},
 				},
 				Writer: buf,
@@ -587,7 +587,7 @@ func TestHelpNameConsistency(t *testing.T) {
 		{
 			Name:               "command1",
 			CustomHelpTemplate: `{{.HelpName}}`,
-			Commands: []*Command{
+			Subcommands: []*Command{
 				{
 					Name:               "subcommand1",
 					CustomHelpTemplate: `{{.HelpName}}`,
@@ -745,7 +745,7 @@ func TestShowSubcommandHelp_SubcommandUsageText(t *testing.T) {
 		Commands: []*Command{
 			{
 				Name: "frobbly",
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{
 						Name:      "bobbly",
 						UsageText: "this is usage text",
@@ -769,7 +769,7 @@ func TestShowSubcommandHelp_MultiLine_SubcommandUsageText(t *testing.T) {
 		Commands: []*Command{
 			{
 				Name: "frobbly",
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{
 						Name: "bobbly",
 						UsageText: `This is a
@@ -1249,7 +1249,7 @@ func TestHideHelpCommand_WithSubcommands(t *testing.T) {
 		Commands: []*Command{
 			{
 				Name: "dummy",
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{
 						Name: "dummy2",
 					},
@@ -1330,7 +1330,7 @@ func TestDefaultCompleteWithFlags(t *testing.T) {
 			}},
 			cmd: &Command{
 				Name: "putz",
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{Name: "futz"},
 				},
 				Flags: []Flag{
@@ -1541,7 +1541,7 @@ func TestWrappedSubcommandHelp(t *testing.T) {
 				Action: func(c *Context) error {
 					return nil
 				},
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{
 						Name:      "grok",
 						Usage:     "remove an existing template",
@@ -1610,7 +1610,7 @@ func TestWrappedHelpSubcommand(t *testing.T) {
 				Action: func(c *Context) error {
 					return nil
 				},
-				Commands: []*Command{
+				Subcommands: []*Command{
 					{
 						Name:      "grok",
 						Usage:     "remove an existing template",
diff --git a/testdata/godoc-v3.x.txt b/testdata/godoc-v3.x.txt
index d047329..4f426b7 100644
--- a/testdata/godoc-v3.x.txt
+++ b/testdata/godoc-v3.x.txt
@@ -483,7 +483,7 @@ type Command struct {
 	// Execute this function if a usage error occurs.
 	OnUsageError OnUsageErrorFunc
 	// List of child commands
-	Commands []*Command
+	Subcommands []*Command
 	// List of flags to parse
 	Flags []Flag
 
@@ -775,10 +775,10 @@ var VersionFlag Flag = &BoolFlag{
 type FlagBase[T any, C any, VC ValueCreator[T, C]] struct {
 	Name string // name of the flag
 
-	Category    string   // category of the flag, if any
-	DefaultText string   // default text of the flag for usage purposes
-	FilePaths   []string // file paths to load value from
-	Usage       string   // usage string for help output
+	Category    string // category of the flag, if any
+	DefaultText string // default text of the flag for usage purposes
+	FilePath    string // file path to load value from
+	Usage       string // usage string for help output
 
 	Required   bool // whether the flag is required or not
 	Hidden     bool // whether to hide the flag in help output