Skip to content

feat: add Local field to FlagMetadata for granular flag inheritance control#12

Merged
mfridman merged 3 commits intomainfrom
mf/flag-inherit
Feb 16, 2026
Merged

feat: add Local field to FlagMetadata for granular flag inheritance control#12
mfridman merged 3 commits intomainfrom
mf/flag-inherit

Conversation

@mfridman
Copy link
Collaborator

@mfridman mfridman commented Feb 16, 2026

This PR adds a Local field to FlagMetadata that prevents a flag from being inherited by child commands.

Flags like --version typically only make sense on the root command, while flags like --verbose should propagate down.

Setting Local: true opts a flag out of inheritance. It remains fully functional on the command that defines it but is invisible to children during parsing, required-flag checks, and help output.

Fix #2

@mfridman mfridman merged commit 9980cd3 into main Feb 16, 2026
3 checks passed
@mfridman mfridman deleted the mf/flag-inherit branch February 16, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: more granular control of flag inheritance

1 participant

Comments