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

New prompt option: if-no-arg #17

Merged
merged 5 commits into from
Apr 4, 2019
Merged

Conversation

iamturns
Copy link
Contributor

This PR introduces a new option prompt: if-no-arg.

It's useful when you want to provide a default value for a prompt, but don't want to prompt if the argument is provided.

Example

"install-dependencies": {
    describe: "Install dependencies",
    type: "confirm",
    default: true,
    prompt: 'if-no-arg',
  },

If --install-dependencies argument is not provided, the question is prompted with a default value of true.

If --install-dependencies argument is provided, the question is not prompted.

@iamturns iamturns changed the title feat: if-no-arg prompt option New prompt option: if-no-arg Mar 27, 2019
Copy link
Owner

@nanovazquez nanovazquez left a comment

Choose a reason for hiding this comment

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

Some minor changes in the docs/comments + a change to pass the linter check.

README.md Outdated Show resolved Hide resolved
src/yargs-interactive.js Outdated Show resolved Hide resolved
src/yargs-interactive.js Show resolved Hide resolved
nanovazquez and others added 3 commits March 29, 2019 18:58
Co-Authored-By: iamturns <matt@iamturns.com>
Co-Authored-By: iamturns <matt@iamturns.com>
Co-Authored-By: iamturns <matt@iamturns.com>
@nanovazquez
Copy link
Owner

Hey @iamturns, this PR to your branch adds tests for this new prompt value, increasing the coverage. Could you please take a look and merge it? iamturns#1

@iamturns
Copy link
Contributor Author

iamturns commented Apr 3, 2019

Very nice work @nanovazquez - all merged!

@nanovazquez nanovazquez merged commit c91a74e into nanovazquez:master Apr 4, 2019
@nanovazquez
Copy link
Owner

🎉 This PR is included in version 2.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants