Skip to content

Command action removes last parameter value #1219

Closed
@krazyjakee

Description

@krazyjakee
program
  .command("a <b> <c> <d>")
  .action((a, b, c, d) => {
    // a, b & c are string values as expected
    // d is the Command class object
  })
  .parse(process.argv);

The workaround is to add an extra, unused argument until this is fixed.

program
  .command("a <b> <c> <d> [x]")
  .action((a, b, c, d) => {
    // a, b, c & d are string values as expected
  })
  .parse(process.argv);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions