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

Cannot pass an argument -A to scripts #3138

Closed
Fenzland opened this issue Oct 17, 2019 · 6 comments
Closed

Cannot pass an argument -A to scripts #3138

Fenzland opened this issue Oct 17, 2019 · 6 comments

Comments

@Fenzland
Copy link
Contributor

test.js

#!/usr/bin/env deno

console.log(Deno.args);
> ./test.js -B
[ "./test.js", "-B" ]
> ./test.js -A
[ "./test.js" ]
@Fenzland Fenzland changed the title Cannot pass a argument -A to script Cannot pass an argument -A to scripts Oct 17, 2019
@bartlomieju
Copy link
Member

That's because -A is an alias for --allow-all permission flag.

@Fenzland
Copy link
Contributor Author

That's because -A is an alias for --allow-all permission flag.

But I just pass it to the script rather then deno.

It's unfriendly to let coder to avoid all deno options when design scripts, and change API when deno add a new option that the script happen to use.

@bartlomieju
Copy link
Member

bartlomieju commented Oct 17, 2019

That's because -A is an alias for --allow-all permission flag.

But I just pass it to the script rather then deno.

It's unfriendly to let coder to avoid all deno options when design scripts, and change API when deno add a new option that the script happen to use.

Yes, agreed. There's already issue for that #3011 (title is different but it's the same underlying problem)

@Fenzland
Copy link
Contributor Author

Yes, agreed. There's already issue for that #3011 (title is different but it's the same underlying problem)

./foo.js -B -- -A is also monstrous, maybe -- also use in script.

@nayeemrmn
Copy link
Collaborator

nayeemrmn commented Oct 17, 2019

Duplicate of #2798.

We seem to have agreed there that simply passing everything after the script name to the script would be most desirable... though nothing's happened.

#3011 is unrelated: it says that deno penetrates the -- when seeking more unnamed arguments (like the module name). That's not occurring here. The -- for this usage works fine but people don't like it.

@bartlomieju
Copy link
Member

This should be fixed after #3389 landed

@ry ry closed this as completed Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants