On 3/16/2017 11:47 PM, Andrei Borzenkov wrote:
16.03.2017 22:13, Brian K. White пишет:
And the windows cmd command line parsing is absolutely terrible example. You may not understand or like the rules that all of the unix shells follow, but the at least have rules, which they follow, and which are consistent and predictable and allow you to express anything you need.
Except
a) there are no rules how each individual command will interpret mix of "option" and "non-option" arguments.
b) heck, there is even no notion of what "option" is - each command is free to define what it treats as "option" and what it treats as "argument".
So no, do not start me on Unix consistency. While shell expansion may be consistent, what commands do with result of shell expansion is not.
What I said was that the bourne shell is a well defined and yes, well designed interface. Feel free to "fix" it if you find it complicated. It's only been honed by legitimate geniuses millions of users for 40 years, literally 40, 1977 to 2017, but hey you probably can clean it all up and make something that is powerful enough to express all problems, yet be simple enough for my mom to use it without ever suffering any unexpected action. Until then, you have no business talking about poor design. You sound like a kid who never learned how to drive a manual transmission claiming that they are a poor design because he never figured it out and doesn't like how he tried to jump in the car and go, but instead it just stalled. Stupid car, poor design. Of course every program is free to parse it's command line arguments however it wishes. Just like it's free to do pretty mush anything else it wishes, which is totally different from every other program. One program sends faxes, another manipulates the bluetooth device, another displays icons on a desktop. A utility like rsync has pretty different requirements of it's commandline than cat or echo. What they do with their commandline is no different than what they do with their memory allocation or the open file descriptors. This is just a completely idiotic idea to even try to float. Similarly, trying to have a program detect that "this looks like an option but it's in the middle of a bunch of filenames" and treat that like an error is idiotic. That is a perfectly useful option which exists for a reason, not by some oversight of those stupid blundering shell or getopt authors. It's intentional to be able to, for example, build a command line from a loop, which changes options as the loop goes along. opt file file opt opt file opt file... -- bkw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org