summaryrefslogtreecommitdiff
path: root/std/flags/README.md
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2020-05-09 13:34:47 +0100
committerGitHub <noreply@github.com>2020-05-09 08:34:47 -0400
commitf184332c09c851faac50f598d29ebe4426e05464 (patch)
tree2659aba63702537fcde1bb64ddeafea1e5863f3e /std/flags/README.md
parent2b02535028f868ea8dfc471c4921a237747ccd4a (diff)
BREAKING(std): reorganization (#5087)
* Prepend underscores to private modules * Remove collectUint8Arrays() It would be a misuse of Deno.iter()'s result. * Move std/_util/async.ts to std/async * Move std/util/sha*.ts to std/hash
Diffstat (limited to 'std/flags/README.md')
-rw-r--r--std/flags/README.md13
1 files changed, 5 insertions, 8 deletions
diff --git a/std/flags/README.md b/std/flags/README.md
index e9764f913..0b7f7fa65 100644
--- a/std/flags/README.md
+++ b/std/flags/README.md
@@ -12,12 +12,12 @@ console.dir(parse(args));
```
```
-$ deno run example.ts -a beep -b boop
+$ deno run https://deno.land/std/examples/flags.ts -a beep -b boop
{ _: [], a: 'beep', b: 'boop' }
```
```
-$ deno run example.ts -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
+$ deno run https://deno.land/std/examples/flags.ts -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
{ _: [ 'foo', 'bar', 'baz' ],
x: 3,
y: 4,
@@ -56,16 +56,13 @@ options can be:
the `--` and `parsedArgs['--']` with everything after the `--`. Here's an
example:
```ts
+ // $ deno run example.ts -- a arg1
const { args } = Deno;
import { parse } from "https://deno.land/std/flags/mod.ts";
- // options['--'] is now set to false
console.dir(parse(args, { "--": false }));
- // $ deno run example.ts -- a arg1
- // output: { _: [ "example.ts", "a", "arg1" ] }
- // options['--'] is now set to true
+ // output: { _: [ "a", "arg1" ] }
console.dir(parse(args, { "--": true }));
- // $ deno run example.ts -- a arg1
- // output: { _: [ "example.ts" ], --: [ "a", "arg1" ] }
+ // output: { _: [], --: [ "a", "arg1" ] }
```
- `options.unknown` - a function which is invoked with a command line parameter
not defined in the `options` configuration object. If the function returns