Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add run CLI subcommand #2215

Merged
merged 24 commits into from May 3, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

update deno run help

  • Loading branch information...
bartlomieju committed May 3, 2019
commit 14a102bb0bf02db151d38e32d3c4879ad88924c4
@@ -169,8 +169,23 @@ Prettier dependencies on first run.
AppSettings::DisableHelpSubcommand,
AppSettings::DisableVersion,
AppSettings::SubcommandRequired,
]).about("Run provided file")
.arg(
]).about("Run a program given a filename or url to the source code")
.long_about(
"
Run a program given a filename or url to the source code.
By default all programs are run in sandbox without access to disk, network or
ability to spawn subprocesses.
deno run https://deno.land/welcome.ts
# run program with permission to read from disk and listen to network
deno run --allow-net --allow-read https://deno.land/std/http/file_server.ts
# run program with all permissions
deno run -A https://deno.land/std/http/file_server.ts
",
).arg(
Arg::with_name("allow-read")
.long("allow-read")
.help("Allow file system read access"),
@@ -203,8 +218,7 @@ Prettier dependencies on first run.
Arg::with_name("no-prompt")
.long("no-prompt")
.help("Do not use prompts"),
)
.subcommand(
).subcommand(
// this is a fake subcommand - it's used in conjunction with
// AppSettings:AllowExternalSubcommand to treat it as an
// entry point script
@@ -393,8 +407,14 @@ mod tests {

#[test]
fn test_flags_from_vec_3() {
let (flags, subcommand, argv) =
flags_from_vec(svec!["deno", "run", "-r", "-D", "--allow-write", "script.ts"]);
let (flags, subcommand, argv) = flags_from_vec(svec![
"deno",
"run",
"-r",
"-D",
"--allow-write",
"script.ts"
]);
assert_eq!(
flags,
DenoFlags {
@@ -541,18 +541,10 @@ USAGE:
deno [FLAGS] [OPTIONS] [SUBCOMMAND]

FLAGS:
-A, --allow-all Allow all permissions
--allow-env Allow environment access
--allow-high-precision Allow high precision time measurement
--allow-net Allow network access
--allow-read Allow file system read access
--allow-run Allow running subprocesses
--allow-write Allow file system write access
-h, --help Prints help information
-D, --log-debug Log debug output
--no-prompt Do not use prompts
-r, --reload Reload source code cache (recompile TypeScript)
--v8-options Print V8 command line options
-h, --help Prints help information
-D, --log-debug Log debug output
-r, --reload Reload source code cache (recompile TypeScript)
--v8-options Print V8 command line options

OPTIONS:
-c, --config <FILE> Load compiler configuration file
@@ -564,7 +556,7 @@ SUBCOMMANDS:
fmt Format files
help Prints this message or the help of the given subcommand(s)
info Show source file related info
run Run provided file
run Run a program given a filename or url to the source code
types Print runtime TypeScript declarations
version Print the version

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.