Deno: Cannot pass an argument `-A` to scripts

Created on 17 Oct 2019  路  6Comments  路  Source: denoland/deno

test.js

#!/usr/bin/env deno

console.log(Deno.args);
> ./test.js -B
[ "./test.js", "-B" ]
> ./test.js -A
[ "./test.js" ]

Most helpful comment

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.

All 6 comments

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

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.

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)

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.

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.

This should be fixed after #3389 landed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zugende picture zugende  路  3Comments

ry picture ry  路  3Comments

ry picture ry  路  3Comments

watilde picture watilde  路  3Comments

motss picture motss  路  3Comments