summaryrefslogtreecommitdiff
path: root/std/flags/mod.ts
diff options
context:
space:
mode:
authorNayeem Rahman <muhammed.9939@gmail.com>2020-03-10 16:08:58 +0000
committerGitHub <noreply@github.com>2020-03-10 12:08:58 -0400
commit6443e4aed16868c17111a56634aa733211430f46 (patch)
tree8ecbe4d75592fcc78a147b4d69fb61530a0ca2f8 /std/flags/mod.ts
parentfbc4731256a698c07d0d842575d3678d7dc58715 (diff)
refactor: Cleanup options object parameters (#4296)
Diffstat (limited to 'std/flags/mod.ts')
-rw-r--r--std/flags/mod.ts16
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: {},