diff options
| author | Ry Dahl <ry@tinyclouds.org> | 2019-11-26 08:06:32 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-26 08:06:32 -0800 |
| commit | c016684653df45c3c3bc88d79dfc295ea5c6426f (patch) | |
| tree | 3cced64c9bace85163f5b4b0f4882a6548fa2905 /std | |
| parent | f88dc4e197f36842b13843dd88da3d74d67578e5 (diff) | |
refactor: reorganize flags (#3389)
- Remove ability to specify run arguments like `--allow-net` after the
script argument. It's too hacky to make work with clap.
- Remove `--v8-options`, instead use `--v8-flags=--help`
- Give more descriptive names to unit tests in flags.rs
- Assume argv and subcommand into DenoFlags struct so the output of
flags module is only DenoFlags rather than the tuple (subcommand, flags,
argv).
- Improve CLI help text
- Make `deno run` specific args like `--allow-net` only show up in 'deno
help run' instead of as global flags in `deno help`.
- Removes `deno version` to simplify our implementation and be closer to
clap defaults. `deno -V` now only shows Deno's version and not V8's nor
TypeScript. `Deno.versions` can be used to see that information.
- Prevent clap from auto-detecting terminal width and attempting to wrap
text.
Diffstat (limited to 'std')
| -rw-r--r-- | std/http/server_test.ts | 6 | ||||
| -rw-r--r-- | std/manual.md | 55 |
2 files changed, 22 insertions, 39 deletions
diff --git a/std/http/server_test.ts b/std/http/server_test.ts index b9ca14630..30070b272 100644 --- a/std/http/server_test.ts +++ b/std/http/server_test.ts @@ -494,7 +494,7 @@ test({ async fn(): Promise<void> { // Runs a simple server as another process const p = Deno.run({ - args: [Deno.execPath(), "http/testdata/simple_server.ts", "--allow-net"], + args: [Deno.execPath(), "--allow-net", "http/testdata/simple_server.ts"], stdout: "piped" }); @@ -535,9 +535,9 @@ test({ const p = Deno.run({ args: [ Deno.execPath(), - "http/testdata/simple_https_server.ts", "--allow-net", - "--allow-read" + "--allow-read", + "http/testdata/simple_https_server.ts" ], stdout: "piped" }); diff --git a/std/manual.md b/std/manual.md index 434d2d17b..2582184ed 100644 --- a/std/manual.md +++ b/std/manual.md @@ -676,56 +676,39 @@ if (import.meta.main) { Use `deno help` to see the help text. ``` -deno A secure JavaScript and TypeScript runtime -Docs: https://deno.land/manual.html +Docs: https://deno.land/std/manual.md Modules: https://deno.land/x/ Bugs: https://github.com/denoland/deno/issues -To run the REPL: +To run the REPL supply no arguments: deno -To execute a sandboxed script: - - deno https://deno.land/std/examples/welcome.ts - To evaluate code from the command line: deno eval "console.log(30933 + 404)" -To get help on the another subcommands (run in this case): +To execute a script: + + deno https://deno.land/std/examples/welcome.ts + +The default subcommand is 'run'. The above is equivalent to + + deno run https://deno.land/std/examples/welcome.ts - deno help run +See 'deno help run' for run specific flags. USAGE: - deno [OPTIONS] [SUBCOMMAND] + deno [SUBCOMMAND] OPTIONS: - -A, --allow-all Allow all permissions - --allow-env Allow environment access - --allow-hrtime Allow high resolution time measurement - --allow-net=<allow-net> Allow network access - --allow-read=<allow-read> Allow file system read access - --allow-run Allow running subprocesses - --allow-write=<allow-write> Allow file system write access - -c, --config <FILE> Load compiler configuration file - --current-thread Use tokio::runtime::current_thread - -h, --help Prints help information - --importmap <FILE> Load import map file - --lock <FILE> Check the specified lock file - --lock-write Write lock file. Use with --lock. - -L, --log-level <log-level> Set log level [possible values: debug, info] - --no-fetch Do not download remote modules - -r, --reload=<CACHE_BLACKLIST> Reload source code cache (recompile TypeScript) - --seed <NUMBER> Seed Math.random() - --v8-flags=<v8-flags> Set V8 command line options - --v8-options Print V8 command line options - -v, --version Print the version + -h, --help Prints help information + -L, --log-level <log-level> Set log level [possible values: debug, info] + -V, --version Prints version information SUBCOMMANDS: - [SCRIPT] Script to run bundle Bundle module and dependencies into single file completions Generate shell completions eval Eval script @@ -734,17 +717,17 @@ SUBCOMMANDS: help Prints this message or the help of the given subcommand(s) info Show info about cache or info related to source file install Install script as executable + repl Read Eval Print Loop run Run a program given a filename or url to the source code test Run tests types Print runtime TypeScript declarations - version Print the version xeval Eval a script on text segments from stdin ENVIRONMENT VARIABLES: - DENO_DIR Set deno's base directory - NO_COLOR Set to disable color - HTTP_PROXY Set proxy address for HTTP requests (module downloads, fetch) - HTTPS_PROXY Set proxy address for HTTPS requests (module downloads, fetch) + DENO_DIR Set deno's base directory + NO_COLOR Set to disable color + HTTP_PROXY Proxy address for HTTP requests (module downloads, fetch) + HTTPS_PROXY Same but for HTTPS ``` ### Environmental variables |
