comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Creem <jeff@thecreems.com>
Subject: Re: DOS Options
Date: Wed, 05 Dec 2007 05:15:01 GMT
Date: 2007-12-05T05:15:01+00:00	[thread overview]
Message-ID: <hbmh25-5vk.ln1@newserver.thecreems.com> (raw)
In-Reply-To: <1i8m324.g6pon43ql1ogN%csampson@inetworld.net>

Charles H. Sampson wrote:
>      I've been using GNAT 3.15p for a long time to write DOS-like
> project utiities to run on my Wintel desktop.  I've just come up with a
> case where I'd like to implement optional parameters.  Since the utility
> is DOS-like, I want to use the DOS form of optional parameters: attached
> to the name of the command, separated by the '/' character.
> 
>      I don't see how to do this.  Command_Line.Argument doesn't accept a
> value of 0, which I remember as being the substring of the command line
> from the first non-blank up to the first suceeding blank.  The note in
> A.15 says that Command_Name is the equivalent of argv (0), but in GNAT
> that's really just the command name, options stripped off.
> 
>      Does anybody have any suggestions?
> 
>                         Charlie
> 

I don't know what you mean about remembering 0 being the first substring 
  of the command line? Remember from where?

ada.command_line.argument(1) certainly returns the first argument to the 
program regardless of whether it is DOS, Unix, etc. It even appears to 
handle the degenerate case of no space between the command and the 
argument.

Perhaps I am missing the point of your question. since

my_command /option_1 /option_2
and even
my_command/option_1 /option_2

work such that ada.command_line.argument(1) returns /option_1
and ada.command_line.argument(2) returns /option_2

But since this is the most obvious thing I assume I am not really 
understanding your problem.



  reply	other threads:[~2007-12-05  5:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-05  3:34 DOS Options Charles H. Sampson
2007-12-05  5:15 ` Jeffrey Creem [this message]
2007-12-19 18:00   ` Charles H. Sampson
2007-12-19 19:40     ` Gautier
2007-12-19 22:59       ` Randy Brukardt
2007-12-19 23:36         ` Adam Beneschan
2007-12-20 22:15           ` Randy Brukardt
2007-12-19 22:47     ` Randy Brukardt
2007-12-19 22:47     ` Randy Brukardt
2007-12-19 22:47     ` Randy Brukardt
2007-12-21  0:39       ` Jeffrey R. Carter
2007-12-22  0:45         ` Randy Brukardt
2007-12-19 22:47     ` Randy Brukardt
2007-12-05 10:06 ` gautier_niouzes
2007-12-05 10:19 ` Stephen Leake
2007-12-05 14:51 ` Charles H. Sampson
2007-12-05 20:06 ` anon
replies disabled

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