Interpret a list of user-provided CLI arguments, returning the relevant ones
in a compact form. Does not error when given invalid options (eg. -z), but
does warn on incorrect positional arguments (eg. no docker image).
This function is rife with side effects. yargs prints to console whenever
the --help and --version options are invoked. It also reads
package.json to find the package's current version.
Parameters
argv: readonly string[]
A list of option arguments to parse. Be mindful that node.js
prepends extra arguments to process.argv; if using this function from node,
be sure to use process.argv.slice(2).
Interpret a list of user-provided CLI arguments, returning the relevant ones in a compact form. Does not error when given invalid options (eg.
-z
), but does warn on incorrect positional arguments (eg. no docker image).This function is rife with side effects.
yargs
prints to console whenever the--help
and--version
options are invoked. It also readspackage.json
to find the package's current version.