Wednesday 4 August 2004 — This is over 20 years old. Be careful.
So, I love cygwin, because it gives me powerful Unix command line tools for my Windows machine. Thank you. I love it. But: would it kill them to accept -? as a request for help?
$ diff -?
diff: invalid option -- ?
diff: Try `diff --help' for more information.
Why? What would be so terrible about understanding dash-query? I type it every time I want help, and have to look at that stupid error message every time. Grr...
Comments
To get round this you'd have to quote or escape the -? as '-?' or -\?, which you'd probably keep forgetting to do. It'd get really annoying.
But on shells that didn't eat question marks (like DOS, and cygwin is designed to work with DOS), it would make the utilities that much user friendlier.
Why be dogmatic?
Your confusion probably stems from the fact that most of the standard utilities have a common set of traits, so you reasonably assume those traits come from a single source, and that it might be Cygwin, when in fact the source is just the crushing deadweight of decades of Unixy/GNUish force of habit, from under which computing might never extract itself.
They could maintain forks of the shells and add in -? -> --help translation, but I think that'd be a lot of work and wouldn't work for all commands anyhow.
You could download the bash source and add in the support yourself. I think that's your best bet.
Note also that "make windows feel like unix" was a secondary concern - we built Cygwin specifically so that *gcc and gdb* could easily run hosted on Windows (for embedded targets, not native code.) The rest was a side effect - not necessarily a good one, as it has caused people to continue using windows in some cases - and some of the more exotic things (like pty support) were external contributions. (Every so often I see people who go from windows to cygwin and then to unix from there, which makes up for it :-)
Regardless, if you really want to fix your problem, you're better off making modifications to bash or whatever shell you use and rolling your own version. If you know c it should be pretty easy to do.
Bob's suggestion above is a good one: I should look into adding the -? support myself and contributing it back.
In regards to Bob's suggestion, I'm a little confused. Are you suggesting you're going to add -? handling to all the GNU command line tools or just to diff?
I really think you're better off adding it to your shell--that's really much easier effort-wise. Otherwise you're going to have your forks of a thousand command line tools rather than a fork of one shell.
I'm only mentioning this because I've been following your blog and you're a nice guy with a real problem that I sympathize with. If you want, I can look into the bash shell adjustment. I think that's the cygwin default shell.
I really do understand your frustration with not having -?. It drives me crazy when I'm in MS Word and vim commands don't work. I've been working in vim so long that it's the way I think. It really disrupts my thinking when Word flips out on me because I'm typing weird vim stuff.
BTW: I don't use bash or any other advanced shell. I use the DOS command window, so getting it to do something different is out of the question.
I don't think you can have an alias after a command, you can only alias commands.. but, if you only use 10 or 12 commands, it would be pretty easy to do it like this:
alias -- ls-?="ls --help"
alias -- cd-?="cd --help"
So you lose the space in between command and -?, but you get to use your preferred method of -? seamlessly.
Add a comment: