Skip to content

Commit

Permalink
fix: too many exmaples in dump (api7#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 authored Feb 28, 2024
1 parent 8fbc593 commit ab4733b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions apps/cli/src/command/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ export class BaseCommand extends Command {
}

public addExample(exmaple: string) {
this.exmaples.push(exmaple);
this.addHelpText('after', () => {
return `\nExample:\n\n${this.exmaples
.map((example) => ` $ ${example}`)
.join('\n')}\n`;
});
if (this.exmaples.length === 0)
this.addHelpText('after', () => {
return `\nExample:\n\n${this.exmaples
.map((example) => ` $ ${example}`)
.join('\n')}\n`;
});

this.exmaples.push(exmaple);
return this;
}
}
Expand Down

0 comments on commit ab4733b

Please sign in to comment.