From: Krishnan Sridhar Newsgroups: alt.folklore.computers Subject: Using '--' to specify command line options ... Date: Thu, 13 Aug 1998 12:44:12 -0500 Organization: Texas Instruments Lines: 13 Message-ID: <35D325EC.EAFE534A@ti.com> NNTP-Posting-Host: plum07.msp.sc.ti.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [en] (X11; U; SunOS 5.5.1 sun4u) Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news.belnet.be!news-raspail.gip.net!news-peer.gip.net!news.gsl.net!gip.net!news-peer.sprintlink.net!news.sprintlink.net!wn3feed!worldnet.att.net!204.127.161.33!worldnet!attbt1!mis1!news.ti.com!not-for-mail A lot of GNU programs/shell scripts seem to require that command line options be preceded by '--' instead of the good old UNIX tradition of using just a '-'. In fact, in some of the man pages of these, it is stated that use of '-' to indicate command line options is "deprecated". What is the reason for this? - Krishnan Sridhar ###### From: Marco S Hyman Newsgroups: alt.folklore.computers Subject: Re: Using '--' to specify command line options ... Date: 13 Aug 1998 13:03:22 -0700 Organization: S.N.A.F.U. (www.snafu.org) Lines: 21 Message-ID: References: <35D325EC.EAFE534A@ti.com> NNTP-Posting-Host: dumbcat.codewright.com X-Trace: 903038603 23953 marc 206.86.0.12 X-Newsreader: Gnus v5.5/Emacs 20.2 Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news-ge.switch.ch!news.maxwell.syr.edu!feed2.news.erols.com!erols!news1.best.com!nntp2.ba.best.com!not-for-mail Krishnan Sridhar writes: > A lot of GNU programs/shell scripts seem to require that command line > options be preceded by '--' instead of the good old UNIX tradition of > using just a '-'. > In fact, in some of the man pages of these, it is stated that use of > '-' to indicate command line options is "deprecated". > > What is the reason for this? Someone (Stallman?) believes that --foobar is more readable/understandable than -f. I think versatility comes into the picture, too as I can have both --foobar and --fubar but there is only one -f. Kind of like VMS :-) Another GNU convention is that man pages are to be replaced by info files. I find that much more annoying. // marc ###### From: mattack@area.com (Matt Ackeret) Newsgroups: alt.folklore.computers Subject: Re: Using '--' to specify command line options ... Date: 13 Aug 1998 15:17:30 -0700 Organization: Area Systems, Mountain View, California, USA Lines: 15 Message-ID: <6qvolq$ehl$1@vax.area.com> References: <35D325EC.EAFE534A@ti.com> NNTP-Posting-Host: vax102.area.com X-Newsposter: Pnews 4.0-test46 (31 Oct 96) Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news-ge.switch.ch!feed1.news.luth.se!luth.se!newspump.monmouth.com!newspeer.monmouth.com!news.he.net!nixon.area.com!vax.area.com!not-for-mail In article <35D325EC.EAFE534A@ti.com>, Krishnan Sridhar wrote: >A lot of GNU programs/shell scripts seem to require that command line >options be preceded by '--' instead of the good old UNIX tradition of using >just a '-'. In fact, in some of the man pages of these, it is stated that >use of '-' to indicate command line options is "deprecated". > >What is the reason for this? Isn't this a POSIX requirement? That is, to fit the POSIX standard for command-line programs, there have to be full-word options, and I thought that -- was the distinguishing feature between --this as a full word option and -this turning on the "t", "h", "i", and "s" options. -- mattack@area.com ###### Path: ccw.ch!usenet From: Neil Franklin Newsgroups: alt.folklore.computers Subject: Re: Using '--' to specify command line options ... Date: 13 Aug 1998 21:43:06 +0200 Organization: My own Private Self Lines: 20 Message-ID: References: <35D325EC.EAFE534A@ti.com> X-Newsreader: Gnus v5.3/Emacs 19.34 Krishnan Sridhar writes: > > A lot of GNU programs/shell scripts seem to require that command line > options > be preceded by '--' instead of the good old UNIX tradition of using just > a '-'. > In fact, in some of the man pages of these, it is stated that use of > '-' to indicate > command line options is "deprecated". Single - is for the backward compatible concatenable 1 letter options. Double -- is for the new written out ones, each with own -- This is because --crap is _not_ -crap = -c -r -a -p -- home: Neil.Franklin@ccw.ch.remove http://www.ccw.ch/Neil.Franklin/ work: franklin@arch.ethz.ch.remove http://caad.arch.ethz.ch/~franklin/ *** It's true ! I read it on Usenet and the Web ! *** ###### Newsgroups: alt.folklore.computers From: Derry Hamilton Subject: Re: Using '--' to specify command line options ... In-Reply-To: <35D325EC.EAFE534A@ti.com> X-Nntp-Posting-Host: tardis.tardis.ed.ac.uk Content-Type: TEXT/PLAIN; charset=US-ASCII Message-ID: Sender: cnews@dcs.ed.ac.uk (UseNet News Admin) Organization: Department of Computer Science, Edinburgh University References: <35D325EC.EAFE534A@ti.com> Mime-Version: 1.0 Date: Fri, 14 Aug 1998 12:15:56 GMT Approved: Me. Lines: 31 Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news-ge.switch.ch!news.maxwell.syr.edu!rill.news.pipex.net!pipex!server1.netnews.ja.net!newsfeed.ed.ac.uk!dcs.ed.ac.uk!tardis.tardis.ed.ac.uk!rasilon On Thu, 13 Aug 1998, Krishnan Sridhar wrote: > A lot of GNU programs/shell scripts seem to require that command line > options > be preceded by '--' instead of the good old UNIX tradition of using just > a '-'. > In fact, in some of the man pages of these, it is stated that use of > '-' to indicate > command line options is "deprecated". > > What is the reason for this? > > - Krishnan Sridhar the use of -- usually indicates a long form of the command, ie. -v is equivalent to --verbose. The deprecation seems to stem from commands where the use of - may cause confusion in future versions. However it is a pain, if you look at the headers, you will see that I am posting from a Solaris system. Here ps for instance requires the - (as in ps -ax) but I usually use a new Linux box where it is deprecated. Thus I have to keep the habit of using -. Then again, never mind, at least it is not as bad as the UNIX/DOS path seperator confusion Derry Hamilton rasilon@tardis.ed.ac.uk /******************************************************************** * I think your cats need tuning - according to a couple of quick * * measurements on a recently calibrated reference cat, the dominant * * frequency of a correctly adjusted cat should be 12Hz +/-20%. * * ===Lionel Lauer on a.s.r=== * *********************************************************************/ ###### From: Chuck McManis Newsgroups: alt.folklore.computers Subject: Re: Using '--' to specify command line options ... Date: Fri, 14 Aug 1998 12:46:48 -0700 Lines: 4 Message-ID: <35D49428.4F4BC6D5@freegate.com> References: <35D325EC.EAFE534A@ti.com> <6qvolq$ehl$1@vax.area.com> NNTP-Posting-Host: 208.226.86.180 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.04 [en] (Win95; U) Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news.belnet.be!news-raspail.gip.net!news-peer.gip.net!news.gsl.net!gip.net!peerfeed.ncal.verio.net!Supernews60!supernews.com!uunet!in1.uu.net!not-for-mail Single dash "-" was used with getopt, and getopt _required_ single character option names. The GNU folks like word option names and chose '--' to distinguish between them. Some transistional programs support both. ###### From: lyndon@orthanc.ab.ca Newsgroups: alt.folklore.computers Subject: Re: Using '--' to specify command line options ... Date: 14 Aug 1998 13:56:33 -0600 Organization: Videotron Communications Ltd. Lines: 61 Sender: lyndon@thingfish.v-wave.com Message-ID: <87lnorqqvi.fsf@thingfish.v-wave.com> References: <35D325EC.EAFE534A@ti.com> <6qvolq$ehl$1@vax.area.com> NNTP-Posting-Host: thingfish.v-wave.com X-Newsreader: Gnus v5.5/Emacs 20.2 Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news.belnet.be!news-raspail.gip.net!news-peer.gip.net!news.gsl.net!gip.net!news.maxwell.syr.edu!scanner.worldgate.com!rover.ucs.ualberta.ca!news.videotron.ab.ca!not-for-mail mattack@area.com (Matt Ackeret) writes: > Isn't this a POSIX requirement? That is, to fit the POSIX standard for > command-line programs, there have to be full-word options, and I thought > that -- was the distinguishing feature between --this as a full word option > and -this turning on the "t", "h", "i", and "s" options. IEEE 1003.2-1992 section 2.10.1 Utility Argument Syntax: ... "The arguments that consist of hyphens and single letters or digits, such as -a, are known as options (or, historically, flags)." I.e., single '-' introduction for options. The '--' convention is used to delimit options from arguments where one of the arguments begins with a '-' character. For example: rm -f -a would result in rm barfing about an unrecognized option -a instead of removing the file -a. The getopt(3) function introduced the notion of '--' terminating option processing, thus: rm -f -- -a would do the right thing. (And yes, I know about rm -f ./-a, which is not the point here.) getopt(3) also enforces the notion of single '-' introducting options, and POSIX merely ratified that behaviour. I don't recall when getopt(3) '--' behaviour was introduced into UNIX. The GNU '--long_name' convention was created because the GNU folks wanted verbose option names, and needed a way to disambiguate them from single '-x' style options. As I recall, this was put to an informal vote on the net in the mid-to-late 80's. (There were some alternative suggestions on how to handle this, and I no longer recall what they were.) (I voted for --foo.) So, what you have today looks like this: -a traditional short form option -a foo ditto, with an option value -argh a bastardization of -a -r -g -h, not officially blessed, and not consistently applied. --argh GNU long style option 'argh' --argh mumble (does GNU officially sanction this?) --argh=mumble GNU long format option with a value -- getopt(3) 'everything after this is an argument' flag - By itself, traditionally used to indicate 'read from stdin' where you would normally have a filename argument. (e.g. cat a - b > c) And then there is dd(1). --lyndon ###### Newsgroups: alt.folklore.computers From: hoh@approve.se.NO_JUNK_EMAIL (Goran Larsson) Subject: Re: Using '--' to specify command line options ... Message-ID: <1998Aug15.070403.3881@lorelei.approve.se> Originator: hoh@approve.se.NO_JUNK_EMAIL (Goran Larsson) Sender: hoh@lorelei.approve.se.NO_JUNK_EMAIL (Goran Larsson) Organization: [1] + 5934 done /bin/rm -rf ~/ & X-No-Archive: yes X-Newsreader: trn 4.0-test66 (4 June 1998) References: <35D325EC.EAFE534A@ti.com> <6qvolq$ehl$1@vax.area.com> <87lnorqqvi.fsf@thingfish.v-wave.com> Lines: 14 Date: Sat, 15 Aug 1998 07:08:26 GMT NNTP-Posting-Host: 130.244.240.138 NNTP-Posting-Date: Sat, 15 Aug 1998 09:08:26 MET DST Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news-ge.switch.ch!news-fra1.dfn.de!news-fra.maz.net!newsfeed1.swip.net!swipnet!nntpserver.swip.net!not-for-mail In article <87lnorqqvi.fsf@thingfish.v-wave.com>, wrote: > And then there is dd(1). ..and odd programs like ar, tar, and dump where the first argument is a bunch of option letters without the '-' and the following arguments are then option values in the same order as of the option letters wanting values. -- Goran Larsson hoh AT approve DOT se I was an atheist, http://home1 DOT swipnet DOT se/%7Ew-12153/ until I found out I was God. ###### From: lyndon@orthanc.ab.ca Newsgroups: alt.folklore.computers Subject: Re: Using '--' to specify command line options ... Date: 15 Aug 1998 12:43:47 -0600 Organization: The Frobozz Magic Homing Pigeon Company Lines: 19 Sender: lyndon@thingfish.v-wave.com Message-ID: <87lnoqdr18.fsf@thingfish.v-wave.com> References: <35D325EC.EAFE534A@ti.com> <6qvolq$ehl$1@vax.area.com> <87lnorqqvi.fsf@thingfish.v-wave.com> <1998Aug15.070403.3881@lorelei.approve.se> NNTP-Posting-Host: thingfish.v-wave.com X-Newsreader: Gnus v5.5/Emacs 20.2 Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news.belnet.be!news-raspail.gip.net!news-peer.gip.net!news.gsl.net!gip.net!logbridge.uoregon.edu!scanner.worldgate.com!rover.ucs.ualberta.ca!news.videotron.ab.ca!not-for-mail hoh@approve.se (Goran Larsson) writes: > > And then there is dd(1). > > ..and odd programs like ar, tar, and dump where the first > argument is a bunch of option letters without the '-' and > the following arguments are then option values in the same > order as of the option letters wanting values. Yes, but that wasn't really what I was getting at. There were a few "old" UNIX commands that didn't use the '-' convention. These were commands like dump and tar, where the "options" weren't really optional. Modern versions all seems to work properly with '-' (and the ones in POSIX have to from my reading of the spec). dd is a completely different beast though. It's the only UNIX command I'm aware of that uses JCL style syntax for options. --lyndon ###### Newsgroups: alt.folklore.computers Subject: Re: Using '--' to specify command line options ... References: <35D325EC.EAFE534A@ti.com> <6qvolq$ehl$1@vax.area.com> <87lnorqqvi.fsf@thingfish.v-wave.com> Organization: Plethora . Net - More Net, Less Spam! X-Newsreader: trn 4.0-test62 (21 February 1998) From: seebs@plethora.net (Peter Seebach) Lines: 40 Message-ID: Date: Sun, 16 Aug 1998 00:47:24 GMT NNTP-Posting-Host: 205.166.146.8 NNTP-Posting-Date: Sat, 15 Aug 1998 19:47:24 CDT Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news.belnet.be!news-raspail.gip.net!news-peer.gip.net!news.gsl.net!gip.net!europa.clark.net!209.98.98.32!chippy.visi.com!news-out.visi.com!ptah.visi.com!not-for-mail In article <87lnorqqvi.fsf@thingfish.v-wave.com>, wrote: > -argh a bastardization of -a -r -g -h, not officially > blessed, and not consistently applied. I'm pretty sure it is, in fact, officially blessed and mandated by POSIX; the confusing case is when '-a' takes an argument; do you mean -a rgh or -argh [a's argument] and not everyone agrees. > --argh GNU long style option 'argh' > --argh mumble (does GNU officially sanction this?) That's the canonical form. > --argh=mumble GNU long format option with a value Huh. I'd never seen this, and my options library (which tries to support Nearly Everything) doesn't look for or know about equals signs. > -- getopt(3) 'everything after this is an argument' > flag Does the same thing in GNU programs, typically. > - By itself, traditionally used to indicate > 'read from stdin' where you would normally > have a filename argument. (e.g. cat a - b > c) I loathe this one because it's a special case which only some programs use. I never use it anymore; modern BSD systems, at least, have /dev/stdin. -s -- Copyright '98, All rights reserved. Peter Seebach / seebs@plethora.net C/Unix wizard, Pro-commerce radical, Spam fighter. Boycott Spamazon! Seeking interesting programming projects. No recruiters need apply. Visit my new ISP --- More Net, Less Spam! ###### From: lucvdv@null.net (Luc Van der Veken) Newsgroups: alt.folklore.computers Subject: Re: Using '--' to specify command line options ... Date: Sun, 16 Aug 1998 08:50:55 GMT Organization: . Lines: 20 Message-ID: <35d68e18.82345@news.innet.be> References: <35D325EC.EAFE534A@ti.com> <6qvolq$ehl$1@vax.area.com> <87lnorqqvi.fsf@thingfish.v-wave.com> NNTP-Posting-Host: pool02b-194-7-99-47.uunet.be Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Newsreader: Forte Agent 1.5/32.451 X-No-Archive: yes Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news.belnet.be!news-raspail.gip.net!news-lond.gip.net!news.gsl.net!gip.net!rill.news.pipex.net!pipex!warm.news.pipex.net!join.news.pipex.net!pipex!krypton.inbe.net!INbe.net!not-for-mail Also sprach seebs@plethora.net (Peter Seebach) on Sun, 16 Aug 1998 00:47:24 GMT to alt.folklore.computers: > > --argh=mumble GNU long format option with a value > > Huh. I'd never seen this, and my options library (which tries to support > Nearly Everything) doesn't look for or know about equals signs. Do you really mean _never_ seen it? A simple "man ls" on my system clearly shows things like --sort={...} --ignore=pattern --color[={yes,no,tty}] -- MS *really* start to think they invented everything. Now they added electricity: in the last line of FreeCell's statistics, they express 'Current' in 'wins'.