Hi guys!
I need help in commander node.js library. I need to create this CLI that accepts 3 flags, --input, --output and --pattern, for example:
commander .version('3.0.0') .usage('[options] <file ...>') .option('-i, --input', 'Array of files to be extracted') .option('-o, --output', 'Output file name') .option('-p, --pattern', 'Pattern name to be used in the extraction') .parse(process.argv);
My problem is with the input flag. I need to send several files, for this I need an array data type.
The problem is that I just can't figure out how to do this:
node ./bin/extract -i ../files/*.PDF
Become an array with all my files located in my file directory. I am already trying to run each sample in the documentation, and I have not found a solution for my problem. Also, I searched in the problems and didnβt find one ... that is strange, maybe I'm doing something wrong, and you guys could help?
Thanks!
user5526811
source share