Fix handling for non-existent or empty config files #61

Merged
JakeGuy11 merged 54 commits from master into master 2021-08-12 16:30:13 +00:00
Showing only changes of commit 366501dce3 - Show all commits

View file

@ -11,8 +11,9 @@ const availableFilenameVars = [
const appArgv = (cfg) => {
// init
return yargs.parserConfiguration({
'duplicate-arguments-array': false,
const argv = yargs.parserConfiguration({
'duplicate-arguments-array': true,
"camel-case-expansion": false
})
// main
.wrap(Math.min(120)) // yargs.terminalWidth()
@ -212,6 +213,15 @@ const appArgv = (cfg) => {
// --
.argv;
// Resolve unwanted arrays
for (let key in argv) {
if (argv[key] instanceof Array && !(key === "subLang" || key === "dub")) {
argv[key] = argv[key].pop()
}
}
return argv;
};
const showHelp = yargs.showHelp;