Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/alloy_folk/deps.ts>cliffy.parseFlags

An application installer for restriced macOS
Go to Latest
function cliffy.parseFlags
Re-export
import { cliffy } from "https://deno.land/x/alloy_folk@v1.1.1/deps.ts";
const { parseFlags } = cliffy;

Parse command line arguments.

Type Parameters

optional
O extends Record<string, any> = Record<string, any>
optional
T extends IFlagOptions = IFlagOptions

Parameters

args: string[]

Command line arguments e.g: Deno.args

optional
opts: IParseOptions<T> = [UNSUPPORTED]

Parse options.

// example.ts -x 3 -y.z -n5 -abc --beep=boop foo bar baz --deno.land -- --cliffy
parseFlags(Deno.args);
{
flags: {
x: "3",
y: { z: true },
n: "5",
a: true,
b: true,
c: true,
beep: "boop",
deno: { land: true }
},
unknown: [ "foo", "bar", "baz" ],
literal: [ "--cliffy" ]
}