-
Notifications
You must be signed in to change notification settings - Fork 3.9k
chore: Command Configs #8776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: latest
Are you sure you want to change the base?
chore: Command Configs #8776
Conversation
| if (this.definitions) { | ||
| this.definitions = this.definitions | ||
| } else { | ||
| this.definitions = definitions | ||
| } | ||
|
|
||
| const definitionsPool = { ...definitions, ...this.definitions } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part seems weird to me, we're merging potentially both into definitionsPool, with this.definitions taking predecent. But if there are no this.definitions then they are both the same value so why do we care about both. This probably needs a quick boolean tree to see what to do in all 4 cases (has/doesn't have definitions and has/doesn't have this.definitions)
Command-Specific Flags Implementation Checklist
This PR enables commands to define their own distinct flags separate from global configuration, eliminating the need for verbose prefixed flags like
--init-nameand allowing cleaner command-specific options.Key Features
flagsconfiguration source - Adds a dedicated layer in the config hierarchy for command-specific flags without modifying existing sourcesloadCommand()method to merge command-specific definitions with global definitions--name) instead of verbose prefixed versions (e.g.,--init-name)Implementation Tasks
flagsto config source hierarchy (betweenenvandcli)loadCommand(definitions)method for dynamic definition merging#warningsarray) to delay logging until after command loadremoveWarnings(types)to clear superseded warnings#deduplicateWarnings()to prevent duplicate warningslogWarnings()method to flush captured warningsexclusiveflag validation across merged definitionscheckUnknown()to recognize bothcliandflagssources