gulp has very few flags to know about. All other flags are for tasks to use if needed.
-vor--versionwill display the global and local gulp versions--require <module path>will require a module before running the gulpfile. This is useful for transpilers but also has other applications. You can use multiple--requireflags--gulpfile <gulpfile path>will manually set path of gulpfile. Useful if you have multiple gulpfiles. This will set the CWD to the gulpfile directory as well--cwd <dir path>will manually set the CWD. The search for the gulpfile, as well as the relativity of all requires will be from here-Tor--taskswill display the task dependency tree for the loaded gulpfile. It will include the task names and their description.--tasks-simplewill display a plaintext list of tasks for the loaded gulpfile--verifywill verify plugins referenced in project's package.json against the plugins blacklist--colorwill force gulp and gulp plugins to display colors even when no color support is detected--no-colorwill force gulp and gulp plugins to not display colors even when color support is detected--silentwill disable all gulp logging
The CLI adds process.env.INIT_CWD which is the original cwd it was launched from.
Refer to this StackOverflow link for how to add task specific flags
Tasks can be executed by running gulp <task> <othertask>. Just running gulp will execute the task you registered called default. If there is no default task gulp will error.
You can find a list of supported languages at interpret. If you would like to add support for a new language send pull request/open issues there.
gulp.task('one', function(done) {
// do stuff
done();
});
gulp.task('two', function(done) {
// do stuff
done();
});
gulp.task('three', three);
function three(done) {
done();
}
three.description = "This is the description of task three";
gulp.task('four', gulp.series('one', 'two'));
gulp.task('five',
gulp.series('four',
gulp.parallel('three', function(done) {
// do more stuff
done();
})
)
);Command: gulp -T or gulp --tasks
Output:
[20:58:55] Tasks for ~\exampleProject\gulpfile.js
[20:58:55] ├── one
[20:58:55] ├── two
[20:58:55] ├── three This is the description of task three
[20:58:55] ├─┬ four
[20:58:55] │ └─┬ <series>
[20:58:55] │ ├── one
[20:58:55] │ └── two
[20:58:55] ├─┬ five
[20:58:55] │ └─┬ <series>
[20:58:55] │ ├─┬ four
[20:58:55] │ │ └─┬ <series>
[20:58:55] │ │ ├── one
[20:58:55] │ │ └── two
[20:58:55] │ └─┬ <parallel>
[20:58:55] │ ├── three
[20:58:55] │ └── <anonymous>Command: gulp --tasks-simple
Output:
one
two
three
four
five