[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Proposed improved patch for yaird



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 16 Oct 2005 08:30:41 +0200
Sven Luther <sven.luther@wanadoo.fr> wrote:

> On Sat, Oct 15, 2005 at 09:59:21PM +0200, Jonas Smedegaard wrote:

> > -while getopts "d:km:o:r:" flag; do
> > -	case $flag in
> > -	d)
> > -		echo "$PROG: $flag unsupported"
> > +TEMP=`getopt -o d:km:o:r: --long
> > supported-host-version:,supported-target-version: -n "$prg" -- "$@"`
> 
> Neat, but i guess that this syntax was not included in the getopt
> documentation i found, or i would have used it.

Beware of the difference between getopts (bash builtin)
and /usr/bin/getopt

See /usr/share/doc/util-linux/examples/getopt-parse.bash.gz (I pretty
much just did a copy'n'paste from there) and getopt(1).


> > +# Check for non-GNU getopt
> > +if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
> 
> Is --long a NGNU getopt feature, and are we always guaranteed to have
> such a thing ? 

Yes, GNU getopt is part of util-linux so I believe it is safe to rely
on, yes.


 - Jonas

- -- 
* Jonas Smedegaard - idealist og Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

 - Enden er nær: http://www.shibumi.org/eoti.htm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDUiVon7DbMsAkQLgRAkjJAJ9lV0X7ARfWD+r785zaGpQ5tTaJeACfUlZW
C4yjMG9IdKAfDOZmbHDMHfk=
=P7zF
-----END PGP SIGNATURE-----



Reply to: