-
Notifications
You must be signed in to change notification settings - Fork 73
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
fix: default help behaves properly #678
Conversation
@W-12513575@
src/parser/parse.ts
Outdated
flags[k] = defaultValue | ||
} | ||
} | ||
|
||
for (const k of Object.keys(this.input.flags)) { | ||
if ((k in flags) && Reflect.has(this.input.flags[k], 'defaultHelp')) { |
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.
could this be done in the previous for loop? both iterate over the keys of this.input.flags
https://github.com/oclif/core/blob/main/src/parser/parse.ts#L268-L290
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.
@cristiand391 When defaultHelp is called it is passed all resolved flag values (flags), which can only be done after all previous loops are finished.
* fix: defaultHelp not called with flag value at runtime @W-12513575@ * chore(release): 2.8.1-beta.1 [skip ci] * chore: move defaultHelp capture to after all flags have been parsed * chore: force build * fix: force build * chore(release): 2.8.1-beta.4 [skip ci] * fix: default help behaves properly @W-12513575@ --------- Co-authored-by: svc-cli-bot <[email protected]>
@W-12513575@