Added test suite
All checks were successful
Build / Build NPM Project (push) Successful in 1m16s
Build / Tag Version (push) Successful in 14s
Build / Publish Documentation (push) Successful in 53s

This commit is contained in:
2025-05-14 16:30:42 -04:00
parent cf122ef9e8
commit fec373ca4c
32 changed files with 1719 additions and 310 deletions

View File

@ -72,10 +72,11 @@ export class ArgParser {
extras.push(arg);
continue;
}
const value = argDef.default === false ? true :
argDef.default === true ? false :
queue.splice(queue.findIndex(q => q[0] != '-'), 1)[0] ||
argDef.default;
const value = combined[1] != null ? combined [1] :
argDef.default === false ? true :
argDef.default === true ? false :
queue.splice(queue.findIndex(q => q[0] != '-'), 1)[0] ||
argDef.default;
if(value == null) parsed['_error'].push(`Option missing value: ${argDef.name || combined[0]}`);
parsed[argDef.name] = value;
} else { // Command