-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed as not planned
Labels
area/v3relates to / is being considered for v3relates to / is being considered for v3kind/cleanupdescribes internal cleanup / maintaincedescribes internal cleanup / maintaincekind/featuredescribes a code enhancement / feature requestdescribes a code enhancement / feature request
Milestone
Description
Some of the fields on Command
are related and may be grouped together for clarity. For example, these Help.+
fields could be grouped together under a Help
field:
HideHelp
➡️Help.Hidden
HideHelpCommand
➡️Help.CommandHidden
or these fields related to shell completion could be under a ShellCompletion
field:
EnableShellCompletion
➡️ShellCompletion.Enabled
ShellCompletionCommandName
➡️ShellCompletion.CommandName
or all of these could be grouped under an Options
or Config
field (?):
cmd := &cli.Command{
Name: "foo",
Config: cli.CommandConfig{
HideHelp: true,
EnableShellCompletion: true,
},
}
There are arguable tradeoffs, of course, such as:
- nested fields are more difficult to reason about and more visually complex than a single level of fields
- logical groupings of fields "hides" them from each other
- depending on the "zero value" of simple types means that default values for certain behaviors are tightly coupled to the field names, e.g.
HideSomething
(default on) vs.EnableSomething
(default off) - others I'm surely not thinking about
Ideas and questions and concerns wanted 🙇🏼
Metadata
Metadata
Assignees
Labels
area/v3relates to / is being considered for v3relates to / is being considered for v3kind/cleanupdescribes internal cleanup / maintaincedescribes internal cleanup / maintaincekind/featuredescribes a code enhancement / feature requestdescribes a code enhancement / feature request