-
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: move ctor for command help class to its own function #244
Conversation
Review comments captured in slack: https://platformcloud.slack.com/archives/C01U75RNU1G/p1631567124234900?thread_ts=1631553503.228700&cid=C01U75RNU1G |
@@ -90,6 +90,8 @@ export class Help extends HelpBase { | |||
} | |||
|
|||
public async showHelp(argv: string[]) { | |||
argv = argv.filter(arg => !getHelpFlagAdditions(this.config).includes(arg)) |
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.
Moved the stripping of help flags to showHelp from main.ts.
Other function call via showHelp expect the help flags to be removed.
@@ -51,7 +51,6 @@ export async function run(argv = process.argv.slice(2), options?: Interfaces.Loa | |||
|
|||
// display help version if applicable | |||
if (helpAddition(argv, config)) { | |||
argv = argv.filter(arg => !getHelpFlagAdditions(config).includes(arg)) |
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.
main.ts should not have any knowledge of what showHelp expects in argv, just pass the whole thing as is.
const help = new this.CommandHelpClass(command, this.config, this.opts) | ||
const help = this.getCommandHelpClass(command) |
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.
Do we really need a whole new method for this if this is the only place it's used?
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.
@RodEsp This function will be overridden in the custom help class to allow the determination of short help.
@W-9708749@