Skip to content

feat(interactive-mode): Support interactive as an option - #6

Merged
nanovazquez merged 2 commits into
masterfrom
feat/interactive-as-option
Jan 15, 2018
Merged

feat(interactive-mode): Support interactive as an option#6
nanovazquez merged 2 commits into
masterfrom
feat/interactive-as-option

Conversation

@nanovazquez

Copy link
Copy Markdown
Owner

This PR enables the user to set the interactive mode by default in the tool.

Usage:

const options = {
  interactive: {
    default: true,
  },
  ...
};

yargsInteractive()
  .usage('$0 <command> [args]')
  .interactive(options)
  .then((result) => {
    // The tool will prompt questions and will output your answers.
    // TODO: Do something with the result (e.g result.name)
    console.log(result)
  });

Then in the console, simply run:

➜ node my-cli.js

And the tool will prompt by default.

@nanovazquez
nanovazquez merged commit 41ef7b8 into master Jan 15, 2018
@nanovazquez
nanovazquez deleted the feat/interactive-as-option branch January 15, 2018 13:45
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.

1 participant