From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.119.6 with SMTP id s6mr18655747ywc.51.1462049363398; Sat, 30 Apr 2016 13:49:23 -0700 (PDT) X-Received: by 10.182.117.40 with SMTP id kb8mr334316obb.7.1462049363262; Sat, 30 Apr 2016 13:49:23 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!11no313487qgt.0!news-out.google.com!k10ni207igv.0!nntp.google.com!i5no754469ige.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 30 Apr 2016 13:49:23 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2003:62:4724:c100:14:b7ee:2d4e:669d; posting-account=mOyWBQoAAAD7S-NBmMUOr9hRClcL0vqR NNTP-Posting-Host: 2003:62:4724:c100:14:b7ee:2d4e:669d User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <87cf2215-78b9-4536-94da-7ff4cca4dbef@googlegroups.com> Subject: GNAT.Command_Line and -? From: rrr.eee.27@gmail.com Injection-Date: Sat, 30 Apr 2016 20:49:23 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:30323 Date: 2016-04-30T13:49:23-07:00 List-Id: In a new project I'd like to use some command line parameters. Among others I have defined: with GNAT.Command_Line; use GNAT.Command_Line; ... Cfg_Pub : Command_Line_Configuration; ... Define_Switch (Cfg_Pub, Server_Name_Text'Access, "-h:", Long_Switch => "--host=", Argument => "FQN|IP", Help => "server name or IP address (default: localhost)."); ... Define_Switch (Cfg_Pub, "-?", Long_Switch => "--help", Help => "show this text"); Using "-?" as a Switch always raises the exception Invalid_Switch. This is probably due to the question mark serving as an indicator of an optional argument. I don't want to use "-h" for help as that is already used for the host parameter. Is there a way to define -? as a valid command line option without returning to Ada.Command_Line? regards Rolf