Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Why is it good practice for a cli script to take switch args before file list?

by Sidhekin (Priest)
on Jul 19, 2006 at 17:10 UTC ( [id://562355]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Why is it good practice for a cli script to take switch args before file list?
in thread Why is it good practice for a cli script to take switch args before file list?

I can't see any POSIX on that... Where do you see that?

Thanks for that convenient link.

The arguments following the last options and option-arguments are named "operands".

(Emphasis mine.)

Also on that page, under the heading "Utility Syntax Guidelines":

Guideline 9:
All options should precede operands on the command line.

"Should" and "guidelines" may not be the strongest of words, but the intent seems clear enough for me.

print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!

  • Comment on Re^3: Why is it good practice for a cli script to take switch args before file list?
  • Download Code

Replies are listed 'Best First'.
Re^4: Why is it good practice for a cli script to take switch args before file list?
by leocharre (Priest) on Jul 19, 2006 at 21:06 UTC

    Thank you so much for your help- for finding where that was. After reading the discussion here I have no doubts that the best thing to do is expect options before operands.

    The slight preference of listing paths before options would not be worth the confusion and added bugs at all.

    POSIX ( SUS?, i guess we'll be calling it at some point.. ) has some *must* haves, and *should* haves to qualify for a true POSIX os/app/lib/whatever. I think this case is clearly not a *must* have.. But then, wiping yourself after you #2 is also not a *must* do.
    So.. options before operands it is.

    And I like what merlyn said, makes a ton of sense. I once saw somewhere that a good utility is liberal in what it accepts as input and conservative in what it outputs.. And how people should be more like that. Sigh.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://562355]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-04-18 06:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found