Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3F2FA3A2.5030706@fillmore-labs.com> Date: Tue, 05 Aug 2003 14:31:30 +0200 From: Patrick Eisenacher MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: getopt & output reordering References: <3F2F92F4 DOT 7030906 AT fillmore-labs DOT com> <025d01c35b48$33c5cd80$017c883e AT starfruit> In-Reply-To: <025d01c35b48$33c5cd80$017c883e@starfruit> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: eisenacher AT fillmore-labs DOT com User-Agent: KMail/1.5.9 Organization: Fillmore Labs GmbH X-Complaints-To: abuse AT fillmore-labs DOT com Hi Max, thanks for your quick response. Indeed, setting the POSIXLY_INCORRECT_GETOPT environment variable did the trick and produces a result that is in synch with the man page. Since I don't know anything about the various flavours of getopts around and what is posixly correct and what not, and I guess a lot of other users don't know neither, how about updating the man pages to be in synch with the current behaviour and adding a paragraph on the POSIXLY_INCORRECT_GETOPT stuff? Cheers, Patrick Max Bowsher schrieb: > Patrick Eisenacher wrote: > >>Talking to Tim Waugh, the author of xmlto, revealed that the order of >>arguments doesn't matter on his system (that's Red Hat, I guess), >>whereas it matters indeed on Cygwin. >> >>Investigating it a bit further revealed that Cygwin's getopt differs >>from what he expected: >> >> >>>getopt -- o: xmlto -o foo bar >>> >>>should output this: >>> >>> -o 'foo' -- 'xmlto' 'bar' >> >>Cygwin's getopt outputs like this: >> >>$ getopt -- o: xmlto -o foo bar >> -- 'xmlto' '-o' 'foo' 'bar' >> >>Checking the archive I found a thread from back in January talking about >>the inability of Cygwin's getopt to do reordering of arguments. I guess >>we're facing here the same issue: the option arguments are not output >>before the non-option arguments. >> >>Was any work done wrt this issue? Is anything planned? > > > IIRC, the end result of the discussion was that no consensus could be > reached on whether it was better to reorder or not to reorder, so CGF had to > make a ruling, and he ruled not to reorder. > > Reordering can be enabled by setting POSIXLY_INCORRECT_GETOPT in the > environment, but because getopt is statically linked, this only works for > programs rebuilt since this change was made, and many haven't been yet. > > Max. > -- 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/