import { parseFlags } from "https://dotland.deno.dev/x/lume@v2.4.2/deps/cliffy.ts";
Parse command line arguments.
Type Parameters
TFlagOptions extends FlagOptions
TFlagsResult extends ParseFlagsContext
Parameters
optional
opts: ParseFlagsOptions<TFlagOptions> = [UNSUPPORTED]Parse options.
// examples/flags/flags.ts -x 3 -y.z -n5 -abc --beep=boop foo bar baz --deno.land --deno.com -- --cliffy
parseFlags(Deno.args);
Output:
{
flags: {
x: "3",
y: { z: true },
n: "5",
a: true,
b: true,
c: true,
beep: "boop",
deno: { land: true, com: true }
},
literal: [ "--cliffy" ],
unknown: [ "foo", "bar", "baz" ],
stopEarly: false,
stopOnUnknown: false
}