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

feat: parse flags after script name #2596

Merged
merged 4 commits into from Jun 29, 2019

Conversation

2 participants
@bartlomieju
Copy link
Contributor

commented Jun 28, 2019

Resolved #2580

This PR add functionality to parse flags passed after script URL as Deno flags. Thanks to this you can now pass --reload (and all other recognized Deno flags) as last arg.

Eg:

$ deno https://deno.land/std/http/file_server.ts --allow-net --allow-read

Notes:

  • parsing stops after double dash --
  • -h/--help and -v/--version are forwarded to Deno.args

This functionality works only for run command, ie. deno <script> and deno run <script>

CC @ry

bartlomieju added some commits Jun 28, 2019

@bartlomieju

This comment has been minimized.

Copy link
Contributor Author

commented Jun 28, 2019

CI is failing due to denoland/registry#115

}
);
assert_eq!(subcommand, DenoSubcommand::Run);
assert_eq!(argv, svec!["deno", "script.ts", "--help", "--foo", "bar"]);

This comment has been minimized.

Copy link
@ry

ry Jun 28, 2019

Collaborator

👍

@bartlomieju bartlomieju force-pushed the bartlomieju:feat-parse_script_args branch from e1a9333 to 6c7416a Jun 28, 2019

@ry

ry approved these changes Jun 29, 2019

Copy link
Collaborator

left a comment

LGTM

@ry ry merged commit 38cf346 into denoland:master Jun 29, 2019

3 checks passed

Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@bartlomieju bartlomieju deleted the bartlomieju:feat-parse_script_args branch Jun 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.