Skip to content

Commit

Permalink
JS: Model newer yargs command-line parsing pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusWL committed Oct 25, 2024
1 parent 3448751 commit d3ae4c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ private class DefaultModels extends CommandLineArguments::Range {
or
// `require('commander').opt()` => `{a: ..., b: ...}`
this = commander().getMember("opts").getACall()
or
this = API::moduleImport("yargs/yargs").getReturn().getMember("argv").asSource()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const yargs = require('yargs/yargs');
const { hideBin } = require('yargs/helpers');
const argv = yargs(hideBin(process.argv)).argv; // $ threat-source=commandargs

SINK(argv.foo); // $ MISSING: hasFlow
SINK(argv.foo); // $ hasFlow

// older version
// https://www.npmjs.com/package/yargs/v/7.1.2
Expand Down

0 comments on commit d3ae4c9

Please sign in to comment.