nanovazquez / yargs-interactive

Interactive support for yargs
MIT License
46 stars 9 forks source link

New prompt option: `if-no-arg` #17

Closed iamturns closed 5 years ago

iamturns commented 5 years ago

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.

nanovazquez commented 5 years ago

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? https://github.com/iamturns/yargs-interactive/pull/1

iamturns commented 5 years ago

Very nice work @nanovazquez - all merged!

nanovazquez commented 5 years ago

:tada: This PR is included in version 2.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: