Search code examples
arraysgulpyargs

How to use yargs array syntax with gulp?


Using array syntax of yargs with gulp throws errors. Here is my code:

var argv = require("yargs")
  .array("modules")
  .argv;

and using it like this:

gulp taskname --modules m1 m2
Task 'm2' is not in your gulpfile

How can I set an array using yargs in gulp?


Solution

  • I found a workaround for it:

    gulp taskname --modules m1 --modules m2