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

allow "-" hyphen as an option argument with subcommand #697

Closed
wants to merge 2 commits into from

Conversation

miyajan
Copy link
Contributor

@miyajan miyajan commented Sep 17, 2017

One character "-" hyphen is not accepted as an option argument with subcommand.

e.x. node test subcommand -a - --bravo - --charlie=-

Main command allowed "-" as an option argument in #139 . This patch will allow it also with subcommand.

, should = require('should');

program
.command('subcommand')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please set the indent width to 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abetomo I fixed it. Thank you for your review!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@abetomo
Copy link
Collaborator

abetomo commented Sep 19, 2017

Thank you PR!

@shadowspawn
Copy link
Collaborator

I have got as far as reproducing the problem. I have not confirmed the fix yet.

Copy link
Collaborator

@shadowspawn shadowspawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed and tested code and happy. Thanks for adding test too.

There are two issues, both introduced by changes made since Pull Request submitted:

  1. The test for index being valid has changed on master:
      if ((i + 1) < argv.length && argv[i + 1][0] !== '-') {
  1. There are a number of style changes enforced by eslint (npm run lint)

Are you still interested in making these changes @miyajan or should we make them ourselves?

@shadowspawn
Copy link
Collaborator

Merging into release/3.0.0 branch

shadowspawn added a commit that referenced this pull request Jun 23, 2019
@shadowspawn shadowspawn added the pending release Merged into a branch for a future release, but not released yet label Jun 23, 2019
@shadowspawn
Copy link
Collaborator

shadowspawn commented Jun 24, 2019

I made some minor changes as per my comments, and already had one approval. Merged into v3 and will be included in that release. Closing to make it clear that should not be merged into master.

Thank you for your contributions.

@shadowspawn
Copy link
Collaborator

Available now as a prerelease. See #1001

@shadowspawn
Copy link
Collaborator

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

Successfully merging this pull request may close these issues.

3 participants