From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112102 invoked by alias); 6 Jun 2017 11:54:53 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 110020 invoked by uid 89); 6 Jun 2017 11:54:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=letters, HX-Junkmail-Premium-Raw:score, H*r:9.0.019, HX-Junkmail-Premium-Raw:sk:NO_CTA_ X-HELO: rgout06.bt.lon5.cpcloud.co.uk Received: from rgout0607.bt.lon5.cpcloud.co.uk (HELO rgout06.bt.lon5.cpcloud.co.uk) (65.20.0.134) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Jun 2017 11:54:50 +0000 X-OWM-Source-IP: 86.141.128.130 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-Junkmail-Premium-Raw: score=8/50,refid=2.7.2:2017.6.2.221216:17:8.707,ip=,rules=NO_URI_FOUND, NO_CTA_URI_FOUND, NO_MESSAGE_ID, NO_URI_HTTPS, TO_MALFORMED Received: from localhost.localdomain (86.141.128.130) by rgout06.bt.lon5.cpcloud.co.uk (9.0.019.13-1) (authenticated as jonturney@btinternet.com) id 58F7952B05224511; Tue, 6 Jun 2017 12:54:52 +0100 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH setup 1/9] Allow options which only have long names Date: Tue, 06 Jun 2017 11:55:00 -0000 Message-Id: <20170606115432.105020-2-jon.turney@dronecode.org.uk> In-Reply-To: <20170606115432.105020-1-jon.turney@dronecode.org.uk> References: <20170606115432.105020-1-jon.turney@dronecode.org.uk> X-SW-Source: 2017-06/txt/msg00014.txt.bz2 We're kind of running out of letters for short options :) --- libgetopt++/include/getopt++/DefaultFormatter.h | 7 +++++-- main.cc | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libgetopt++/include/getopt++/DefaultFormatter.h b/libgetopt++/include/getopt++/DefaultFormatter.h index 38287f1..440eb54 100644 --- a/libgetopt++/include/getopt++/DefaultFormatter.h +++ b/libgetopt++/include/getopt++/DefaultFormatter.h @@ -45,8 +45,11 @@ class DefaultFormatter { theStream(aStream) {} void operator () (Option *anOption) { - theStream << s_lead << anOption->shortOption ()[0] - << l_lead << anOption->longOption () + if (anOption->shortOption ()[0] == '\0') + theStream << " "; + else + theStream << s_lead << anOption->shortOption ()[0]; + theStream << l_lead << anOption->longOption () << std::string (o_len - s_lead.size () - 1 - l_lead.size () - anOption->longOption ().size (), ' '); diff --git a/main.cc b/main.cc index fe1d6c1..b44f9b6 100644 --- a/main.cc +++ b/main.cc @@ -94,7 +94,7 @@ static BoolOption NoAdminOption (false, 'B', "no-admin", "Do not check for and e static BoolOption WaitOption (false, 'W', "wait", "When elevating, wait for elevated child process"); static BoolOption HelpOption (false, 'h', "help", "print help"); static StringOption SetupBaseNameOpt ("setup", 'i', "ini-basename", "Use a different basename, e.g. \"foo\", instead of \"setup\"", false); -BoolOption UnsupportedOption (false, '0', "allow-unsupported-windows", "Allow old, unsupported Windows versions"); +BoolOption UnsupportedOption (false, '\0', "allow-unsupported-windows", "Allow old, unsupported Windows versions"); std::string SetupBaseName; static void inline -- 2.12.3