summaryrefslogtreecommitdiff
path: root/std/flags/README.md
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-02-02 19:05:46 +0800
committerGitHub <noreply@github.com>2021-02-02 12:05:46 +0100
commit6abf126c2a7a451cded8c6b5e6ddf1b69c84055d (patch)
treefd94c013a19fcb38954844085821ec1601c20e18 /std/flags/README.md
parenta2b5d44f1aa9d64f448a2a3cc2001272e2f60b98 (diff)
chore: remove std directory (#9361)
This removes the std folder from the tree. Various parts of the tests are pretty tightly dependent on std (47 direct imports and 75 indirect imports, not counting the cli tests that use them as fixtures) so I've added std as a submodule for now.
Diffstat (limited to 'std/flags/README.md')
-rw-r--r--std/flags/README.md67
1 files changed, 0 insertions, 67 deletions
diff --git a/std/flags/README.md b/std/flags/README.md
deleted file mode 100644
index 7b8e508d4..000000000
--- a/std/flags/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-# flags
-
-Command line arguments parser for Deno based on minimist.
-
-# Example
-
-```ts
-import { parse } from "https://deno.land/std@$STD_VERSION/flags/mod.ts";
-
-console.dir(parse(Deno.args));
-```
-
-```
-$ deno run https://deno.land/std/examples/flags.ts -a beep -b boop
-{ _: [], a: 'beep', b: 'boop' }
-```
-
-```
-$ 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,
- n: 5,
- a: true,
- b: true,
- c: true,
- beep: 'boop' }
-```
-
-# API
-
-## const parsedArgs = parse(args, options = {});
-
-`parsedArgs._` contains all the arguments that didn't have an option associated
-with them.
-
-Numeric-looking arguments will be returned as numbers unless `options.string` or
-`options.boolean` is set for that argument name.
-
-Any arguments after `'--'` will not be parsed and will end up in `parsedArgs._`.
-
-options can be:
-
-- `options.string` - a string or array of strings argument names to always treat
- as strings.
-- `options.boolean` - 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`).
-- `options.alias` - an object mapping string names to strings or arrays of
- string argument names to use as aliases.
-- `options.default` - an object mapping string argument names to default values.
-- `options.stopEarly` - when true, populate `parsedArgs._` with everything after
- the first non-option.
-- `options['--']` - when true, populate `parsedArgs._` with everything before
- the `--` and `parsedArgs['--']` with everything after the `--`. Here's an
- example:
- ```ts
- // $ deno run example.ts -- a arg1
- import { parse } from "https://deno.land/std@$STD_VERSION/flags/mod.ts";
- console.dir(parse(Deno.args, { "--": false }));
- // output: { _: [ "a", "arg1" ] }
- console.dir(parse(Deno.args, { "--": true }));
- // 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
- `false`, the unknown option is not added to `parsedArgs`.