function main
main(args?: string[]): Promise<void>

Main CLI entry point.

Plans the invocation with planCli, then carries it out: announces the resolved specifier and any inferred coder on stderr, then either writes the planned text to its stream and exits with its code, or runs the command. A run that throws is explained through explainFailure and exits 1.

Examples

Run a decode from a pipeline

import { main } from "./cli.ts";

await main(["png", "pngFile", "decode"]);

Parameters

optional
args: string[] = [Deno.args]

Command line arguments (defaults to Deno.args)

Return Type

Promise<void>

Usage

import { main } from "cli.ts";