-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
Hi, I have a simple program:
// my-program.js
#!/usr/bin/env node
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
const argv = yargs(hideBin(process.argv));
argv
.scriptName("my-program")
.config()
.option("test", {
"demandOption": true
})
.parse();And a config.json file
{
"test": "teeeest"
}But when I run
node my-program.js --config ./config.json
Options:
--help Show help [boolean]
--version Show version number [boolean]
--config Path to JSON config file
--test test message [required]
Missing required argument: test
It's seems it's not getting the test argument from the config.
"yargs": "^17.2.1"
Reactions are currently unavailable