cling
cling copied to clipboard
feat: print parent command name in subcommand's usage
Currently, the usage help message only prints the command's name, ignoring its lineage.
Suppose you have the following
Greets a person
Usage:
greet <command> <arguments> [options]
Commands:
welcome sends a friendly welcome message
running greet welcome --help currently prints
sends a friendly welcome message
Usage:
welcome <arguments> [options]
which is incomplete, as the actual usage would be greet welcome <arguments> [options].
This is even more apparent the deeper the command is nested. This PR loops through all parents of the given command and appends their names to the usage message, so the above would become:
sends a friendly welcome message
Usage:
greet welcome <arguments> [options]