Tyrrrz / CliFx

Class-first framework for building command-line interfaces
MIT License
1.48k stars 60 forks source link

Add child command usage in help text #77

Closed NikiforovAll closed 3 years ago

NikiforovAll commented 3 years ago

Here is a little proof of concept for #11.

Let's determine the next things:

Note, this is not final implementation. I've created this to communicate ideas and clarify the next steps.

E.g. image

Closes: #11

Tyrrrz commented 3 years ago

Cool!

Q1: Do we always want to show verbose usage every time the help for root command is provided? We could show it only when --help is specified explicitly.

I think for starters we can make it show every time. Later, if we need to, we can adapt.

Q2: Do we want to show verbose usage for sub-commands?

What do you mean by "verbose" here? The example on your screenshot looks good to m e.

Q3: How can we make usage shorter and more user-friendly in the case when the application executable consists of "dotnet MyProgram.dll"?

I think we should keep it as is for now. We can revisit it in a new PR/issue.

Tyrrrz commented 3 years ago

Poke @NikiforovAll. Are you still working on this?

NikiforovAll commented 3 years ago

Poke @NikiforovAll. Are you still working on this?

Not really, but I plan to start working on it this weekend.

Tyrrrz commented 3 years ago

Cool! I'm planning to make a refactoring soon, so wanted to align with the PRs.

NikiforovAll commented 3 years ago

I've removed the process name from usage. This is aligned with other CLIs best practices, e.g git, gh. Demo:

Last descendant command: image

A Command with multiple possibly nested sub-commands: image

Root: image

Command not found: image

Tyrrrz commented 3 years ago

Thanks!