-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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: shorthands for --allow-* flags #19530
Comments
This is not the case:
In the linked issue #668 he says:
Not the same thing as wanting to see them. It's also almost 5 years old. |
Fair enough, he said that he doesn't like the long form and he also doesn't want to deviate from standard args parsing, so I inferred that single-letter flags are the only other option and that we would support them instead. I corrected my wording. Are there any reasons against this change? |
More misrepresentation of what he said. :(
That doesn't mean he doesn't like the long form. This won't work because it takes a lot of the valuable single character namespace for a single part of it, while at the same time obscuring security features. Hopefully it will be declined. There's some upvotes, but fortunately Deno is a principled project. |
Perhaps we should just ask him what his opinion is in 2023 rather than speculating what he could have meant five years ago. @ry? |
|
In the event this is getting accepted, I'm making a pull request. |
I don't think this one should be implemented because it obscures the meaning of the permission flags, which degrades the permission system. Even |
how about |
bash already gives us $ echo --allow-{read,net}
--allow-read --allow-net |
As it stands there's no support for this feature among the core team. We are more interested in exploring alternative solutions like #12763. Closing the issue for now, but feel free to leave comments if you have other opinions, thanks. |
It is tedious to type
--allow-env --allow-net --allow-read
and so on. Ry even said in #668 (review) that he would not be opposed to single-character permission flags.I suggest to add the follow flags to the CLI:
In scripts, it is usually preferable to have longer, more explicit names. They are better at being transparent about which permissions are granted to the program.
However, when running a lot of scripts as one-off commands from the shell, it is very cumbersome to type out the current arguments. It would be very nice to be able to do just
deno run -ERN
and be done with it. (Currently, it is necessary to typedeno run --allow-env --allow-read --allow-net
.)What do you think about this?
The text was updated successfully, but these errors were encountered: