Skip to content

Add dashedOptions for each command #582

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

Merged
merged 1 commit into from
Jun 26, 2015

Conversation

rosen-vladimirov
Copy link
Contributor

Each command can use specific dashed options (-- avd <name> for example is valid for one command, but not for other). Add dashedOptions parameter to ICommand interface and make sure to use it for validation when it exists. In case there's no dashedOptions paramter, use the common options. In order to validate the options, delete yargs from require and require it again as yargs.options(this.options).argv is caching the results and calling it more than once with different options is giving strange results.
Also fixes #539

@rosen-vladimirov rosen-vladimirov self-assigned this Jun 22, 2015
@rosen-vladimirov rosen-vladimirov added this to the 1.2.0 milestone Jun 22, 2015
@ns-bot
Copy link

ns-bot commented Jun 22, 2015

@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/improve-dashed-validation branch from fd01550 to 6bd9619 Compare June 24, 2015 07:08
@ns-bot
Copy link

ns-bot commented Jun 24, 2015

Each command can use specific dashed options (`-- avd <name>` for example is valid for one command, but not for other). Add dashedOptions parameter to ICommand interface and make sure to use it for validation when it exists. In case there's no dashedOptions paramter, use the common options. In order to validate the options, delete yargs from require and require it again as yargs.options(this.options).argv is caching the results and calling it more than once with different options is giving strange results.
Update yargs to 3.12.0
@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/improve-dashed-validation branch from 6bd9619 to 4ff0dd7 Compare June 25, 2015 11:59
@ns-bot
Copy link

ns-bot commented Jun 25, 2015

@Fatme
Copy link
Contributor

Fatme commented Jun 26, 2015

👍

rosen-vladimirov added a commit that referenced this pull request Jun 26, 2015
…alidation

Add dashedOptions for each command
@rosen-vladimirov rosen-vladimirov merged commit 74a647e into master Jun 26, 2015
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/improve-dashed-validation branch June 26, 2015 07:17
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.

Running --log with no args with results in undefined exception instead of good help description
3 participants