Skip to main content
Latest
method Command.prototype.parse
import { Command } from "https://deno.land/x/license@1.0.3/deps/cmd.ts";

Parse argv, setting options and invoking commands when defined.

The default expectation is that the arguments are from node and have the application as argv[0] and the script being run in argv[1], with user parameters after that.

Examples:

 program.parse(process.argv);
 program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions
 program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]

Parameters

optional
argv: string[]
optional
parseOptions: ParseOptions