gc

gulp-command

Use Commander-CLI options in Gulp for passing Command line flags

Showing:

Popularity

Downloads/wk

16

GitHub Stars

6

Maintenance

Last Commit

5yrs ago

Contributors

4

Package

Dependencies

3

Size (min+gzip)

35.4KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

gulp-command

Use Commander-CLI options in Gulp for passing Command line flags

Gulp Command is currently working, However it does not provide all the necessary options quite yet.

Build Status NPM version

Getting Started

Install the module with: npm install gulp-command

Her is an example of how to use gulp-command

var gulp        = require('gulp');
var gulpCommand = require('gulp-command')(gulp);

gulp
    .option('<related-task>', '-f, --flag', 'Description', 'callback')

  • Related-Task: optional

  • -f, --flag: required (both short and long flag are required comma Separated);

  • description: required

  • Callback: optional

If No Related task is specified, the commands can apply to all tasks

However, You still need to pass null If you are not using a task

gulp
    .option(null, '-f, --flag', 'Description', 'callback')

##How to access the flags! As an example, If I used the following flags.

gulp build --thing=awesome -s soo -s totally -s cool

After passing an option property, within then gulp task, you can simply

gulp
    .option('build', '-t, --thing', 'Awesome Thing')
    .option('build', '-s, --sweetness', 'So Totally Cool')
    .task('build', function(){
        console.log(this.flags)
        => {t:'awesome', sweetness: ['so', 'totally', 'awesome']};
    });

If we were to run the same command, but under the default task, we would get the following;

gulp default --thing=awesome -s soo -s totally -s cool
gulp
    .task('default', function(){
        console.log(this.flags)
        => {}
    });

gulp
    .option('build', '-t, --thing', 'Awesome Thing')
    .option('build', '-s, --sweetness', 'So Totally Cool')
    .task('build', function(){
        
    });

Docs

  • documentation - Comming Soon.
  • support - open an issue here.

License

MIT © 2014, joelcoxokc

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial