diff options
Diffstat (limited to 'std/flags')
-rw-r--r-- | std/flags/mod.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/std/flags/mod.ts b/std/flags/mod.ts index 59cae5d15..18727a665 100644 --- a/std/flags/mod.ts +++ b/std/flags/mod.ts @@ -27,31 +27,31 @@ export interface ArgParsingOptions { * * Defaults to `false`. */ - "--": boolean; + "--"?: boolean; /** An object mapping string names to strings or arrays of string argument * names to use as aliases */ - alias: Record<string, string | string[]>; + alias?: Record<string, string | string[]>; /** 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`) */ - boolean: boolean | string | string[]; + boolean?: boolean | string | string[]; /** An object mapping string argument names to default values. */ - default: Record<string, unknown>; + default?: Record<string, unknown>; /** When `true`, populate the result `_` with everything after the first * non-option. */ - stopEarly: boolean; + stopEarly?: boolean; /** A string or array of strings argument names to always treat as strings. */ - string: string | string[]; + string?: string | string[]; /** A function which is invoked with a command line parameter not defined in * the `options` configuration object. If the function returns `false`, the * unknown option is not added to `parsedArgs`. */ - unknown: (i: unknown) => unknown; + unknown?: (i: unknown) => unknown; } interface Flags { @@ -108,7 +108,7 @@ export function parse( stopEarly = false, string = [], unknown = (i: unknown): unknown => i - }: Partial<ArgParsingOptions> = {} + }: ArgParsingOptions = {} ): Args { const flags: Flags = { bools: {}, |