cling icon indicating copy to clipboard operation
cling copied to clipboard

feat: print parent command name in subcommand's usage

Open BigBoyBarney opened this issue 4 months ago • 0 comments

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]

BigBoyBarney avatar Aug 10 '25 21:08 BigBoyBarney