Skip to content

Hidden Commands Should be Ignored When Calculating Use Indentation #1272

@simonjarcher

Description

@simonjarcher

The Command's AddCommand function incorrectly includes hidden commands in its calculation of the maximum lengths needed to display correctly formatted usage information. See the following: Command.go, line 1135

Any Command that has its Hidden field set to true should be ignored, otherwise the formatted usage is potentially wider than it needs to be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good-first-issueIssues that a new contributor could make a PR forkind/bugA bug in cobra; unintended behaviorlifecycle/needs-prReady for a PR from the community

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions