import { type ParseOptions } from "https://dotland.deno.dev/x/lume@v1.13.2/deps/flags.ts";
The options for the parse
call.
Properties
optional
--: DDWhen true
, populate the result _
with everything before the --
and
the result ['--']
with everything after the --
. Here's an example:
// $ deno run example.ts -- a arg1
import { parse } from "https://deno.land/std@$STD_VERSION/flags/mod.ts";
console.dir(parse(Deno.args, { "--": false }));
// output: { _: [ "a", "arg1" ] }
console.dir(parse(Deno.args, { "--": true }));
// output: { _: [], --: [ "a", "arg1" ] }
Defaults to false
.
optional
alias: AAn object mapping string names to strings or arrays of string argument names to use as aliases.
A boolean, string or array of strings to always treat as booleans. If
true
will treat all double hyphenated arguments without equal signs as
boolean
(e.g. affects --foo
, not -f
or --foo=bar
)
A string or array of strings argument names to always treat as arrays. Collectable options can be used multiple times. All values will be collected into one array. If a non-collectable option is used multiple times, the last value is used.