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

View file

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