Replies: 1 comment
-
|
Here's how this change might look: #74 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The root CLI is a command.
Note
Most CLI frameworks model it this way:
Command*cobra.Commandclap::Commandvalues composed into a tree@Command-annotated classes/objectsCommandobjectsCLI::Appobjects (subcommands are Apps too!)There are exceptions —
cli.Appthat contains[]cli.CommandRootCommandrather than justCommandclick.Grouprather than a plainclick.Command— but even among these, it's typical for the root command to extend the branch command (
System.CommandLine.RootCommandextendsSystem.CommandLine.Commandandclick.Groupextendsclick.Command)Both
DocumentandCommandhave fields forarguments,options,commands,examples, etc. HoweverDocumentputs its name and description underinfo.CliInfosubtly diverges fromCommand:CliInfohave atitlebutCommandhas aname?name?CliInfohave asummaryand adescriptionbutCommandonly has adescription?summaryanddescriptiondiffer?Command'sdescriptionintended to be the one-line string displayed in a menu of commands?Command'shiddenflag is perhaps meaningless for the root command, but other than that, I think the spec would be strengthened by modelingDocumentas a superset ofCommand.Beta Was this translation helpful? Give feedback.
All reactions