Skip to content

How to get options from sub command exes #563

@kahunacohen

Description

@kahunacohen

In my 'foo' sub command file (Eg. pm-foo.js) how do I get hold of the options passed?

pm.js:

...
program
  .version('0.0.1')
  .command('foo [name]', 'desc' {a:'b'})
  .parse(process.argv);

I tried passing parameters after the description parameter, but how do you get hold of them in the pm-foo.js file? I tried printing out name in pm-foo.js too. Any help is appreciated.

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