* GNAT.Command_Line and -?
@ 2016-04-30 20:49 rrr.eee.27
2016-04-30 21:00 ` rrr.eee.27
0 siblings, 1 reply; 2+ messages in thread
From: rrr.eee.27 @ 2016-04-30 20:49 UTC (permalink / 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: GNAT.Command_Line and -?
2016-04-30 20:49 GNAT.Command_Line and -? rrr.eee.27
@ 2016-04-30 21:00 ` rrr.eee.27
0 siblings, 0 replies; 2+ messages in thread
From: rrr.eee.27 @ 2016-04-30 21:00 UTC (permalink / raw)
Apparently -h is special too. It must be used for the help text. Using "-h:" doesn't actually work. A given parameter on the commandline is not accepted.
I'll have to give in and use "-H:" for the host and "-h" for help.
regards
Rolf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-30 21:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-30 20:49 GNAT.Command_Line and -? rrr.eee.27
2016-04-30 21:00 ` rrr.eee.27
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox