Skip to content

Conversation

BigBoyBarney
Copy link
Contributor

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]

@summary = @description = "sends a friendly welcome message"

add_argument "name", description: "the name of the person to greet", required: true
add_option 'h', "help", description: "sends help information"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also added the help option to the example, as it was referenced, but not actually included, leading to an error if the user ran it.

@devnote-dev devnote-dev added the bug fix This fixes an existing bug label Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix This fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants