vercel / arg

Simple argument parsing
https://npmjs.com/arg
MIT License
1.23k stars 54 forks source link

Update argv param use es6 default function parameters #41

Closed yuler closed 5 years ago

Qix- commented 5 years ago

Just had to test that this was correct behavior - turns out it is.

function foo(argv = process.argv.slice(2)) {
    console.log(argv);
}

foo(); // []
process.argv.push('--bar');
foo(); // ['--bar']
Qix- commented 5 years ago

Thanks! :)

yuler commented 5 years ago

😄