Skip to content

feat: display subcommands as nested commands instead of as flat list of all commands#29

Open
noamkfir wants to merge 2 commits intolukeed:masterfrom
noamkfir:feature/nested-subcommands
Open

feat: display subcommands as nested commands instead of as flat list of all commands#29
noamkfir wants to merge 2 commits intolukeed:masterfrom
noamkfir:feature/nested-subcommands

Conversation

@noamkfir
Copy link
Copy Markdown

When creating complex or deeply nested commands, the previous behavior displayed a long flat list of all the commands, including all the subcommands at all nested levels.

For example, consider a program with the following list of commands:

  • cmd
  • cmd parent
  • cmd parent one
  • cmd parent two

Running cmd --help would show the complete list, which is probably not the expected behavior, especially as the list of commands grows.

This PR changes the behavior so that only the next level of subcommands is displayed.

  • Running cmd --help will only show cmd parent as an available command.
  • Running cmd parent --help will only show cmd parent one and cmd parent two as available subcommands.

@kioviensis
Copy link
Copy Markdown

@lukeed What can you say about this?
I'm interested in getting it into the master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants