Skip to content

Commit

Permalink
chore: code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 28, 2022
1 parent e94f278 commit 8b34afe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/command.ts
Expand Up @@ -263,7 +263,7 @@ export default abstract class Command {

const deprecateAliases = this.ctor.flags[flag]?.deprecateAliases
const aliases = this.ctor.flags[flag]?.aliases ?? []
if (deprecateAliases && aliases) {
if (deprecateAliases && aliases.length > 0) {
const foundAliases = this.argv.filter(a => aliases.includes(a.replace(/-/g, '')))
for (const alias of foundAliases) {
this.warn(formatFlagDeprecationWarning(alias, {to: this.ctor.flags[flag]?.name}))
Expand Down
2 changes: 1 addition & 1 deletion src/flags.ts
Expand Up @@ -37,7 +37,7 @@ export const help = (opts: Partial<BooleanFlag<boolean>> = {}) => {
description: 'Show CLI help.',
...opts,
parse: async (_: any, cmd: Command) => {
new Help(cmd.config).showHelp([cmd.id!, ...cmd.argv])
new Help(cmd.config).showHelp(cmd.id ? [cmd.id, ...cmd.argv] : cmd.argv)
cmd.exit(0)
},
})
Expand Down

0 comments on commit 8b34afe

Please sign in to comment.