From 6443e4aed16868c17111a56634aa733211430f46 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Tue, 10 Mar 2020 16:08:58 +0000 Subject: refactor: Cleanup options object parameters (#4296) --- std/flags/mod.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'std/flags/mod.ts') 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; + alias?: Record; /** 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; + default?: Record; /** 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 = {} ): Args { const flags: Flags = { bools: {}, -- cgit v1.2.3