<div class="gmail_quote">2009/7/23 Steven W. Orr <span dir="ltr"><<a href="mailto:steveo@syslang.net">steveo@syslang.net</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">-----BEGIN PGP SIGNED MESSAGE-----<br>Hash: SHA1<br><br></div>On 07/22/09 23:20, quoth Tony Nelson:<br>
<div class="im">> On 09-07-22 22:51:23, Steven W. Orr wrote:<br>><br>>> Right. There's a standard for how command options should work.<br>>><br>>> verb options arguments<br>>><br>>> That's why we have getopt and that's why I shudder when I see people<br>

>> reinventing wheels.<br>><br>>>From `man 3 getopt`:<br>><br>>     "By  default,  getopt()  permutes  the  contents  of argv as it<br>>     scans, so that eventually all the non-options are at the end."<br>

><br>> So, the default "standard" is to allow mixed options and arguments.<br>><br><br></div>That's why it's so important to do it correctly. Performing consistency<br>checking is also an important part of the job. For bash programming, I've<br>

actually been using the builtin getopts. If you're in C code, I'd recommend<br>calling getopt with a + prefixing the first arg.<br><br>The main point is that people should design their command lines using POSIX or<br>

SVR4 standards in the first place. Then the decision to use things like getopt<br>or getopts gets a lot easier.<br><br>Take a look at gcc as a classic example of how *not* to do it.<br><br>gcc --help # I'm good with that.<br>

gcc -c # Also good. Let's make object code.</blockquote>
<div> </div>
<div>This is about where I am going to loose it !</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span id=""></span><br>gcc -pipe # That's where you lose me. It's just a good thing they don't have a<br>

 -p, -i or a -e option. Or wait! Maybe they can't now.<br>
<div class="im"></div></blockquote>
<div> </div>
<div> </div>
<div>Ahhhhh, I have lost it !!!!</div>
<div> </div>
<div>Yeah, it really, really, ought to be '--pipe' and I like a ':' or '=' before an attached item like a filename or option.</div>
<div> </div>
<div>Aaron</div>
<div> </div>
<div>P.S. All these inconsistancies are a plot designed by bad programmers to annoy both good users and good programmers alike !</div>
<div> </div></div>