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

Parse argv, setting options and invoking commands when defined.

Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.

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

Parameters

optional
argv: string[]
  • where the args are from: 'node', 'user', 'electron'
optional
parseOptions: ParseOptions