Javascript 基于参数的触发吞咽任务

Javascript 基于参数的触发吞咽任务,javascript,triggers,task,gulp,Javascript,Triggers,Task,Gulp,是否可以根据参数标志触发相关任务 例如: //task one will be triggered like this from the command line gulp one --flag //gulpfile gulp.task('one', function() { if(gutil.env.flag) { //run task two } else { //run task three } }); gulp.task('two', function()

是否可以根据参数标志触发相关任务

例如:

//task one will be triggered like this from the command line
gulp one --flag

//gulpfile
gulp.task('one', function() {
  if(gutil.env.flag) {
    //run task two
  } else {
    //run task three
  }
});

gulp.task('two', function() { });
gulp.task('three', function() { });
与此要求最接近的是gulp.run,但现在已弃用。大多数引用都指向gulp.watch,但我不想查看任何文件。我只需要查找参数并相应地触发任务

编辑1:一位同事指给我看。虽然这符合我的目的,但网站上发布了一条警告,请注意此解决方案是一种黑客行为,可能会停止使用orchestrator的未来更新