comp.lang.ada
 help / color / mirror / Atom feed
From: rrr.eee.27@gmail.com
Subject: GNAT.Command_Line and -?
Date: Sat, 30 Apr 2016 13:49:23 -0700 (PDT)
Date: 2016-04-30T13:49:23-07:00	[thread overview]
Message-ID: <87cf2215-78b9-4536-94da-7ff4cca4dbef@googlegroups.com> (raw)

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 


             reply	other threads:[~2016-04-30 20:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-30 20:49 rrr.eee.27 [this message]
2016-04-30 21:00 ` GNAT.Command_Line and -? rrr.eee.27
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox