Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not add optsObj to arg passed to .command #4

Open
Pajn opened this issue Feb 28, 2018 · 3 comments
Open

Does not add optsObj to arg passed to .command #4

Pajn opened this issue Feb 28, 2018 · 3 comments

Comments

@Pajn
Copy link

Pajn commented Feb 28, 2018

safe-commander does not seem to add optsObj to the command action callback

program.command('command')
    .option('-o, --option')
    .action(command => {
      console.log('optsObj', command.optsObj) // undefined
    })
@bySabi
Copy link
Owner

bySabi commented Feb 28, 2018

I publish a new release that depends on commander 2.11.0 release.
Any commander API beyond this release is not supported right know

Update to safe-commander 2.11.2 and tell me if it's working

@Pajn
Copy link
Author

Pajn commented Mar 1, 2018

It did not work. I made sure that yarn had successfully pulled the new version by looking in the modules package.json.

I think new commands created inside commander avoids the patching this library does https://github.com/tj/commander.js/blob/c92ca1de894f2be09dfc6d0ad714cb84faafbaab/index.js#L176

@bySabi
Copy link
Owner

bySabi commented Mar 1, 2018

Do you have safe-commander 2.11.2 and commander 2.11.0 in node_modules?

I know that some research need to be done for make it work with commander latest, 2.14.x releases, but it should do with commander 2.11.0

This project born like a workaround for some known commander issues that should be solved on commander 3.x branch but it seems that developers continue add features to current 2.X.

I had not time to rework safe-commander right now.

If you need a new Commander API, PR are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants