grunt-choose0.1.3 • Public • Published
Ask the user to choose a task to run in a list.
This plugin requires Grunt
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-choose --save-dev
The "choose" task
The minimal usage of grunt-choose runs with no specific configuration:
When used without configuration, grunt-choose will list all the available tasks and targets, waiting for you to choose the one to run.
Usage with all available options
choose:target:options:message: "Please, choose a task:"multiple: truechoices:"Show me a message !": "message:one""Show me another message !": "message:two""Show me another, different message !":"message:three""message:four"
choice property lists the tasks to be selected by the user.
Object is passed, the properties name will be used as name for the choice, the value will be treated as the task name.
The value can be a unique task (passed as a
string), or multiple tasks (passed as an
"Choose the task to run now :"
Invite message for the prompt.
Allows the user to select multiple tasks.
In this example, we ask the user to choose the next task to run.
If the user selects "Lint my code", the task
jshint will run. If the user selects "Lint and build", the tasks
build:client will be run.
choose:target:options:message: "Please, choose a task:"choices:"Lint my code": "jshint""Lint and build":"jshint""build:client"
grunt-choose is designed to choose and run tasks.
If you want to do more complex things with user's prompt, please consider grunt-prompt.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Note: My english writing is not the best part of my work. :) If you can help me by correcting this README, please, make a Pull Request! Thanks!
- 0.1.0: Initial release (29/04/14)
- 0.1.1: Update dependencies (30/05/14)
Copyright (c) 2014 Leny
Licensed under the MIT license.