4

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?

alisabzevari
  • 8,008
  • 6
  • 43
  • 67

2 Answers2

1

I found a workaround for it:

gulp taskname --modules m1 --modules m2
alisabzevari
  • 8,008
  • 6
  • 43
  • 67
0

Watch out! If you wan't to use required parameter via Gulp. In this case, yargs dosn't act like expected.

See here for more Information: https://stackoverflow.com/a/41412558/1256697

Community
  • 1
  • 1
suther
  • 12,600
  • 4
  • 62
  • 99