[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: cmd line stuff (was: CVS update: ...)

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2000-10-18 21:36:10 CEST

> NO. There is an existing standard command processing interface. It
> is called getopts(). It specifically (and by design) does *not*
> require that options appear before arguments.

The great thing about standards is that there are so many to choose
from. The POSIX getopt() standard *does* require that options appear
before arguments:

        naming-schemes# uname
        NetBSD
        naming-schemes# ls /root -al
        ls: -al: No such file or directory
        /root:
        [Listing of files under /root]

but the gnu getopt implementation does not have that requirement:

        drug-lord% uname
        Linux
        drug-lord% ls /root -al
        total 64

Unless you set POSIXLY_CORRECT:

        drug-lord% setenv POSIXLY_CORRECT
        drug-lord% ls /root -al
        ls: -al: No such file or directory
Received on Sat Oct 21 14:36:11 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.