Replies: 3 comments 8 replies
-
|
Here's how this change might look: #74 |
Beta Was this translation helpful? Give feedback.
-
|
I agree that the current form is awkward (and I've implemented code against the spec). But the solution I would propose would be:
It think this will allow for important meta information for the spec as a whole document but remove the awkwardness of have two object that basically need to understood identically in processing code. |
Beta Was this translation helpful? Give feedback.
-
|
Yes, that is it:
And all the removed parts would be put in that root As for the overlap between between the data in the CliInfo Object
changes:
semantics:
@boblail does that makes sense? Another thing we could consider is the remove the |
Beta Was this translation helpful? Give feedback.
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