args icon indicating copy to clipboard operation
args copied to clipboard

Fails to parse decimal number

Open lpatiny opened this issue 6 years ago • 0 comments

It seems that if one of the parameter if a number containing a decimal it fails (only if there is a default value for this parameter) and returns the integer value.

const args = require('args');
args.option('abc', 'This is a test', 0.123);
console.log(process.argv);
const parsed = args.parse(process.argv);
console.log(parsed);
node src/test.js --abc 0.01
// returns { a: 0, abc: 0 }

lpatiny avatar Jan 29 '20 08:01 lpatiny