Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by swampyankee (Parson)
on Jul 19, 2006 at 17:24 UTC ( [id://562361]=note: print w/replies, xml ) Need Help??


in reply to Why is it good practice for a cli script to take switch args before file list?

I would say, pretty much regardless of O/S, most cli users are used to the form command <switches> <files>. After all, this is how most *ix, VMS, and Windows cli functions seem to work. While there are exceptions e.g., some compilers and printing-oriented utilities, and confusions, such as switches that take file names as arguments, it is normal practice.

Whether or not "normal practice" is "best practice" is a separate issue.

emc

e(π√−1) = −1
  • Comment on Re: Why is it good practice for a cli script to take switch args before file list?

Replies are listed 'Best First'.
Re^2: Why is it good practice for a cli script to take switch args before file list?
by rodion (Chaplain) on Jul 19, 2006 at 21:38 UTC
    I have a minor quibble. Windows took its cli from MSDOS, which didn't care where the options were, so long as they started with a forward slash, and still doesn't. It didn't matter if you needed two passes to parse the command line when you only allowed 128 bytes of command.

    I've never quite forgiven the young Bill Gates and company for going along with IBM's wish to use forward-slash to identify options, as IBM used on their mainframes. It forced them to use back-slash for the directory separator, and I grumble at them every time I get it wrong switching betweeen Unix and MSWindows.

      I thought they got the idea for forward slashes for command switches from VMS. Whether they got the idea from VMS or IBM, backslashes for directory separators was a really bad idea: they're not in a standard place on a keyboard.

      emc

      e(π√−1) = −1

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-25 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found