diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-06-12 20:23:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-12 15:23:38 -0400 |
commit | 1fff6f55c3ba98a10018c6d374795e612061e9b6 (patch) | |
tree | 12074b6d44736b11513d857e437f9e30a6bf65a4 /std/flags | |
parent | 26bf56afdaf16634ffbaa23684faf3a44cc10f62 (diff) |
refactor: Don't destructure the Deno namespace (#6268)
Diffstat (limited to 'std/flags')
-rw-r--r-- | std/flags/README.md | 8 | ||||
-rw-r--r-- | std/flags/mod.ts | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/std/flags/README.md b/std/flags/README.md index 0b7f7fa65..ebfc346e1 100644 --- a/std/flags/README.md +++ b/std/flags/README.md @@ -5,10 +5,9 @@ Command line arguments parser for Deno based on minimist # Example ```ts -const { args } = Deno; import { parse } from "https://deno.land/std/flags/mod.ts"; -console.dir(parse(args)); +console.dir(parse(Deno.args)); ``` ``` @@ -57,11 +56,10 @@ options can be: example: ```ts // $ deno run example.ts -- a arg1 - const { args } = Deno; import { parse } from "https://deno.land/std/flags/mod.ts"; - console.dir(parse(args, { "--": false })); + console.dir(parse(Deno.args, { "--": false })); // output: { _: [ "a", "arg1" ] } - console.dir(parse(args, { "--": true })); + console.dir(parse(Deno.args, { "--": true })); // output: { _: [], --: [ "a", "arg1" ] } ``` - `options.unknown` - a function which is invoked with a command line parameter diff --git a/std/flags/mod.ts b/std/flags/mod.ts index 5c8fcc0d9..a961e6c68 100644 --- a/std/flags/mod.ts +++ b/std/flags/mod.ts @@ -15,11 +15,10 @@ export interface ArgParsingOptions { * the result `['--']` with everything after the `--`. Here's an example: * * // $ deno run example.ts -- a arg1 - * const { args } = Deno; * import { parse } from "https://deno.land/std/flags/mod.ts"; - * console.dir(parse(args, { "--": false })); + * console.dir(parse(Deno.args, { "--": false })); * // output: { _: [ "a", "arg1" ] } - * console.dir(parse(args, { "--": true })); + * console.dir(parse(Deno.args, { "--": true })); * // output: { _: [], --: [ "a", "arg1" ] } * * Defaults to `false`. |