delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/03/01/09:23:52

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Tue, 1 Mar 2005 09:23:23 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Alexander Joerg Herrmann <alexander_herrmann AT yahoo DOT com DOT au>
cc: cygwin AT cygwin DOT com
Subject: Re: getopt required_argument (Was Re: regtool - 1.8 - Core dump)
In-Reply-To: <20050301104759.22913.qmail@web51108.mail.yahoo.com>
Message-ID: <Pine.GSO.4.61.0503010920320.10998@slinky.cs.nyu.edu>
References: <20050301104759 DOT 22913 DOT qmail AT web51108 DOT mail DOT yahoo DOT com>
MIME-Version: 1.0

On Tue, 1 Mar 2005, Alexander Joerg Herrmann wrote:

> > Well, it's just a matter of adding a check for
> > optarg being NULL and
> > printing an appropriate message (e.g.,
> >           if (optarg == NULL) {
> >             fprintf(stderr, "Missing key-value
> > separator\n");
> >             usage();
> >           }
> > ).
> Yup looks easy but I may better patch the DLL to use

FYI, this has been fixed in the snapshots by Christopher Faylor (which
happened between the time I did a "cvs update" and the time I prepared a
patch -- go figure).

> some kind of fstab file which would it make complete
> portable as now I'am sitting in front of a computer
> which let's me run bash but not cmd - ahhhh.

This has been discussed, and, in fact, is a plan for the future.  That was
one of the reasons using "mount" was suggested -- no matter where the
mounts are stored, "mount" will be guaranteed to do the right thing.

> > However, the question is what should getopt's
> > behavior be if something
> > specified as a "required_argument" is missing?
> It sould do the same thing as the long parameter
> arguments imo.

This was my bug -- the long options specified the argument as required,
but the short ones specified it as optional (two colons).  Thanks to CGF
for fixing it.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019