parseArgs
function parseArgs(argv, options?): ParsedArgs;Defined in: src/cli/index.ts:65
Minimal argv parser:
--key value,--key=value(the value may contain=),--flag;- short flags from
short(-t acme→tenant: "acme",-h→help: true); --ends the flags; a malformed--=xstays positional.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
argv |
readonly string[] |
options? |
ParseArgsOptions |
Returns
Section titled “Returns”Example
Section titled “Example”parseArgs(["serve", "--port=4000", "-t", "acme"], { short: { t: "tenant" } });// { _: ["serve"], flags: { port: "4000", tenant: "acme" } }