Skip to content

feat: more granular control of flag inheritance #2

@mfridman

Description

@mfridman

Command flags can be inherited by child commands, but this needs careful handling. Some flags should only affect the root command, while others are useful globally:

  • --version should be root-only since version information applies to the whole program and probably only the root Exec function actually handles this flag
  • --verbose should be inherited since logging verbosity affects most commands

We might want to consider extending FlagMetadata to specify inheritance behavior per flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions