Skip to content

Commit

Permalink
fix: use correct prop name
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Mar 11, 2024
1 parent 7a71524 commit a509fa4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/help/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export class CommandHelp extends HelpFormatter {
if (args.filter((a) => a.description).length === 0) return

return args.map((a) => {
// Add ellipsis to indicate that the argument takes multiple values if static is false
const name = this.command.static === false ? `${a.name.toUpperCase()}...` : a.name.toUpperCase()
// Add ellipsis to indicate that the argument takes multiple values if strict is false
const name = this.command.strict === false ? `${a.name.toUpperCase()}...` : a.name.toUpperCase()
let description = a.description || ''
if (a.default)
description = `${colorize(this.config?.theme?.flagDefaultValue, `[default: ${a.default}]`)} ${description}`
Expand Down
4 changes: 2 additions & 2 deletions src/help/docopts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export class DocOpts {
public toString(): string {
const opts = ['<%= command.id %>']
if (this.cmd.args) {
// If static is false, add ellipsis to indicate that the argument takes multiple values
const suffix = this.cmd.static === false ? '...' : ''
// If strict is false, add ellipsis to indicate that the argument takes multiple values
const suffix = this.cmd.strict === false ? '...' : ''
const a =
Object.values(ensureArgObject(this.cmd.args)).map((arg) =>
arg.required ? `${arg.name.toUpperCase()}${suffix}` : `[${arg.name.toUpperCase()}${suffix}]`,
Expand Down
2 changes: 1 addition & 1 deletion test/help/format-command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ ARGUMENTS
const cmd = await makeLoadable(
makeCommandClass({
id: 'apps:create',
static: false,
strict: false,
args: {
arg1: Args.string({description: 'Show the options'}),
},
Expand Down

0 comments on commit a509fa4

Please sign in to comment.