0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00

Add NO_COLOR to CLI usage (#1843)

This commit is contained in:
Ryan Dahl 2019-02-27 00:14:10 -05:00 committed by GitHub
parent e7e4cb037d
commit 33a6409db9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 32 deletions

View file

@ -39,7 +39,8 @@ pub fn get_usage(opts: &Options) -> String {
format!(
"Usage: deno script.ts {}
Environment variables:
DENO_DIR Set deno's base directory.",
DENO_DIR Set deno's base directory
NO_COLOR Set to disable color",
opts.usage("")
)
}
@ -149,22 +150,22 @@ pub fn set_flags(
// TODO(kevinkassimo): v8_set_flags intercepts '-help' with single '-'
// Resolve that and then uncomment line below (enabling Go style -long-flag)
// opts.long_only(true);
opts.optflag("", "allow-read", "Allow file system read access.");
opts.optflag("", "allow-write", "Allow file system write access.");
opts.optflag("", "allow-net", "Allow network access.");
opts.optflag("", "allow-env", "Allow environment access.");
opts.optflag("", "allow-run", "Allow running subprocesses.");
opts.optflag("A", "allow-all", "Allow all permissions.");
opts.optflag("", "recompile", "Force recompilation of TypeScript code.");
opts.optflag("h", "help", "Print this message.");
opts.optflag("D", "log-debug", "Log debug output.");
opts.optflag("v", "version", "Print the version.");
opts.optflag("r", "reload", "Reload cached remote resources.");
opts.optflag("", "v8-options", "Print V8 command line options.");
opts.optflag("", "types", "Print runtime TypeScript declarations.");
opts.optflag("", "prefetch", "Prefetch the dependencies.");
opts.optflag("", "allow-read", "Allow file system read access");
opts.optflag("", "allow-write", "Allow file system write access");
opts.optflag("", "allow-net", "Allow network access");
opts.optflag("", "allow-env", "Allow environment access");
opts.optflag("", "allow-run", "Allow running subprocesses");
opts.optflag("A", "allow-all", "Allow all permissions");
opts.optflag("", "recompile", "Force recompilation of TypeScript code");
opts.optflag("h", "help", "Print this message");
opts.optflag("D", "log-debug", "Log debug output");
opts.optflag("v", "version", "Print the version");
opts.optflag("r", "reload", "Reload cached remote resources");
opts.optflag("", "v8-options", "Print V8 command line options");
opts.optflag("", "types", "Print runtime TypeScript declarations");
opts.optflag("", "prefetch", "Prefetch the dependencies");
opts.optflag("", "info", "Show source file related info");
opts.optflag("", "fmt", "Format code.");
opts.optflag("", "fmt", "Format code");
let mut flags = DenoFlags::default();

View file

@ -488,25 +488,26 @@ if (window.location.toString() == import.meta.url) {
Usage: deno script.ts
Options:
--allow-read Allow file system read access.
--allow-write Allow file system write access.
--allow-net Allow network access.
--allow-env Allow environment access.
--allow-run Allow running subprocesses.
-A, --allow-all Allow all permissions.
--recompile Force recompilation of TypeScript code.
-h, --help Print this message.
-D, --log-debug Log debug output.
-v, --version Print the version.
-r, --reload Reload cached remote resources.
--v8-options Print V8 command line options.
--types Print runtime TypeScript declarations.
--prefetch Prefetch the dependencies.
--allow-read Allow file system read access
--allow-write Allow file system write access
--allow-net Allow network access
--allow-env Allow environment access
--allow-run Allow running subprocesses
-A, --allow-all Allow all permissions
--recompile Force recompilation of TypeScript code
-h, --help Print this message
-D, --log-debug Log debug output
-v, --version Print the version
-r, --reload Reload cached remote resources
--v8-options Print V8 command line options
--types Print runtime TypeScript declarations
--prefetch Prefetch the dependencies
--info Show source file related info
--fmt Format code.
--fmt Format code
Environment variables:
DENO_DIR Set deno's base directory.
DENO_DIR Set deno's base directory
NO_COLOR Set to disable color
```
### Environmental variables