diff options
Diffstat (limited to 'std/flags')
-rw-r--r-- | std/flags/README.md | 8 | ||||
-rw-r--r-- | std/flags/mod.ts | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/std/flags/README.md b/std/flags/README.md index 41692b619..e9764f913 100644 --- a/std/flags/README.md +++ b/std/flags/README.md @@ -12,12 +12,12 @@ console.dir(parse(args)); ``` ``` -$ deno example.ts -a beep -b boop +$ deno run example.ts -a beep -b boop { _: [], a: 'beep', b: 'boop' } ``` ``` -$ deno example.ts -x 3 -y 4 -n5 -abc --beep=boop foo bar baz +$ deno run example.ts -x 3 -y 4 -n5 -abc --beep=boop foo bar baz { _: [ 'foo', 'bar', 'baz' ], x: 3, y: 4, @@ -60,11 +60,11 @@ options can be: import { parse } from "https://deno.land/std/flags/mod.ts"; // options['--'] is now set to false console.dir(parse(args, { "--": false })); - // $ deno example.ts -- a arg1 + // $ deno run example.ts -- a arg1 // output: { _: [ "example.ts", "a", "arg1" ] } // options['--'] is now set to true console.dir(parse(args, { "--": true })); - // $ deno example.ts -- a arg1 + // $ deno run example.ts -- a arg1 // output: { _: [ "example.ts" ], --: [ "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 3afaf111f..0563dab61 100644 --- a/std/flags/mod.ts +++ b/std/flags/mod.ts @@ -18,11 +18,11 @@ export interface ArgParsingOptions { * import { parse } from "https://deno.land/std/flags/mod.ts"; * // options['--'] is now set to false * console.dir(parse(args, { "--": false })); - * // $ deno example.ts -- a arg1 + * // $ deno run example.ts -- a arg1 * // output: { _: [ "example.ts", "a", "arg1" ] } * // options['--'] is now set to true * console.dir(parse(args, { "--": true })); - * // $ deno example.ts -- a arg1 + * // $ deno run example.ts -- a arg1 * // output: { _: [ "example.ts" ], --: [ "a", "arg1" ] } * * Defaults to `false`. |