3

Yargs api says about .alias(key, alias):

Optionally .alias() can take an object that maps keys to aliases. Each key of this object should be the canonical version of the option, and each value should be a string or an array of strings.

I tried to find example but i didn't found. can someone give code example of that option?

Eran Or
  • 1,252
  • 15
  • 22

1 Answers1

2

Is this what you are looking for?

      .alias({
         help: 'h',
         version: 'v'
       })

instead of:

      .alias('help', 'h)
      .alias('version, 'v)
viery365
  • 935
  • 2
  • 12
  • 30