-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
support command-line args with only one dash #1014
Comments
Not sure why you are thumbs down on that @hayd. The very arbitrary ness of |
@kitsonk I am also a bit in doubt of |
Personally I just don't see what value this adds... and I like the - short -- long convention. |
I like it because its simpler and less to type. Here are other discussions:
http://tldp.org/LDP/abs/html/standard-options.html
|
I'm happy with this compromise! |
Does it mean that if in the future we have e.g.
because we want to use Combining single-letter options is even less to type, much less. I don't know about other people but personally I always write: I don't really understand this decision because it really is more to type for short options and because it is contrary to the convention and user expectations. But my other concern is that if we cannot combine single-letter arguments, then we won't be able to write command-line scripts easily with shebang lines (see issue #929) like this:
Keep in mind that both this: |
@ry #1008 is very nice for interactive uses. Here I am concerned specifically with scripts and shebang lines that don't support multiple arguments unless those are single letter arguments glued together (everything in shebang after first space, even if there are other spaces, is passed as one argument so #!/bin/sh
":" //#; exec /bin/deno -x -y "$0" "$@"
// ... ts code here instead of: #!/bin/deno -xy
// ... ts code here Not that it's impossible but it may be conrary to some people's expectations, plus it gets through another interpretter before dropping privileges so it may have security implications. |
@rsp I'm not sure I understand... I'm quite sure that shebangs can take multiple arguments. And it's usually used with /usr/bin/env... |
@ry I don't know if that's the case on every system (or with every interpreter because I think Deno could split its argv[1] if it starts with a dash and contains whitespace), but I remember using /usr/bin/env I always had to use some tricks like the one above to pass even one argument to the interpreter (as the interpreter name after /usr/bin/env is passed as an argument to env itself). Update: |
I will give up on this for now. #1080 landed support for getopt flag parsing. It's out of scope for us now. |
Switched to
So single dash is still doable, but there will be |
Any easy way to intercept and "slice" out |
With new CLI using Clap this issue is outdated, let's close it. CC @ry |
That's only on some platforms, but most linux distros support only single argument (like Debian and probably most Debian based). |
Golang style. So we should be able to do
The text was updated successfully, but these errors were encountered: