X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=IhlrPTmvG3FE3Ytp QKTtLSTl5VHTcxhoq4k6QOtpIQhfR6UEHsHOaWb6moDT6AKcReNBYIB/iLmUXKB0 749N8hCAFZg7S/ACfgWm/PX1tEkbX3V2rxyXAxHjnUSGaZElyHvqRFS0oDXCVw1S K+bBnjbgmLpibgwUy6jIUE81MDQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=default; bh=knd/MW7quf1wCQ/krV828v G83B4=; b=r8ec47oP3qgSHtD04aOl4IOaP9avEWDxrqqW5A/oHGvfmmFr90y78h aIMG8Xp4/zI1zlM2QftyFu1DRvj0fhZwAkgJuIG1u4w+1P1B/585BfwF1B2sTHeV dXZvNRoHFxTe9A7t0bmQ7rd3cfEYTPxI15DDVH8Vg4fQgFtrLuzhE= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=1.2 required=5.0 tests=BAYES_40,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=HX-Priority:Normal, english, H*RU:192.168.1.10, H*r:ip*192.168.1.10 X-HELO: forward103j.mail.yandex.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1544204103; bh=HiZdTzLvrMie+f2Ps9xO24pEdWjM5gCtN9SnNN3c0rs=; h=Date:From:Reply-To:Message-ID:To:Subject:In-Reply-To:References; b=JYiuWoDJ720dUhCVuPiUOOJ8AEGJXV6bBS5I6213wjFcqPcgGVy+U4LCp1NmkE7nq tXyxncUpt3dLtRr2NxxIpqcgkABAbqcrEfTB/Ljmm7P6UTxLRDBqcUBcQhQ4Nw7UE4 CleTc/ChY7q4iRiIPzcjnIQQZ7yDszNoisHLXlts= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1544204103; bh=HiZdTzLvrMie+f2Ps9xO24pEdWjM5gCtN9SnNN3c0rs=; h=Date:From:Reply-To:Message-ID:To:Subject:In-Reply-To:References; b=JYiuWoDJ720dUhCVuPiUOOJ8AEGJXV6bBS5I6213wjFcqPcgGVy+U4LCp1NmkE7nq tXyxncUpt3dLtRr2NxxIpqcgkABAbqcrEfTB/Ljmm7P6UTxLRDBqcUBcQhQ4Nw7UE4 CleTc/ChY7q4iRiIPzcjnIQQZ7yDszNoisHLXlts= Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru Date: Fri, 7 Dec 2018 20:30:24 +0300 From: Andrey Repin Reply-To: cygwin AT cygwin DOT com Message-ID: <543338755.20181207203024@yandex.ru> To: Houder , cygwin AT cygwin DOT com Subject: Re: util-linux: getopt: broken --name option for a while now In-Reply-To: References: <1655264599 DOT 20181207025650 AT yandex DOT ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Greetings, Houder! > On Fri, 7 Dec 2018 02:56:50, Andrey Repin wrote: >> Greetings, All! >> >> This has been plaguing me for several years, but only now I got to test it >> more thoroughly. >> Shame on me. >> >> $ /usr/bin/getopt --options '+H' --shell sh --name x -- -d >> getopt: unknown option -- d >> >> Expected output: >> x: unknown option -- d >> >> $ /usr/bin/getopt -V >> getopt from util-linux 2.25.2 >> >> Poked around, >> getopt from 2.20.1, 2.27.1, 2.31.1 and (reportedly)2.33 works as expected. > 2.27.1? Typo? No, just a different OS. # lsb_release -a; /usr/bin/getopt -V; /usr/bin/getopt --options '+H' --shell sh --name x -- -d No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.5 LTS Release: 16.04 Codename: xenial getopt from util-linux 2.27.1 x: invalid option -- 'd' -- > See: > https://stackoverflow.com/questions/43078330/how-to-use-the-name-argument-to-getopt > ( How to use the --name argument to getopt? ) > "This is a bug (or just a non-portability issue) which is already fixed in > util-linux 2.28, by commit 30fbf2f6. Before this fix it worked only on Linux, That explains it. > OSX and a few BSD flavors but not on WIN32 or GNU-Hurd for example". > The answer by "rudimeier" also decribes a temporary work-around. -- With best regards, Andrey Repin Friday, December 7, 2018 20:24:07 Sorry for my terrible english... -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple