comp.lang.ada
 help / color / mirror / Atom feed
From: csampson@inetworld.net (Charles H. Sampson)
Subject: Re: DOS Options
Date: Wed, 19 Dec 2007 10:00:52 -0800
Date: 2007-12-19T10:00:52-08:00	[thread overview]
Message-ID: <1i9d4ab.twgszk4zp5evN%csampson@inetworld.net> (raw)
In-Reply-To: hbmh25-5vk.ln1@newserver.thecreems.com

Jeffrey Creem <jeff@thecreems.com> wrote:
> ...
> 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
> ...

     Just to tie a ribbon around this, here's what I've discovered since
Jeffrey and the others set me on the right path.  But first, what
Jeffrey thinks in a degenerate case I thought was a requirement.  That
is, I thought the slash-headed options had to be jammed against the
command, no spaces allowed.

     Be that as it may, I found out that, for the GNAT 3.15p version of
Ada.Command_Line, if the command name is followed immediately by a '/',
that slash and everything following it up to the first blank is
presented as Argument (1).  From that point on, blanks act as separators
between parameters.

     This has the effect that it's still necessary to write a parser for
Argument (1), something I thought Ada.Command_Line might be taking care
of.  I'm talking about the case of multiple slash-headed options jammed
against the command:

        command/x/y/z

I was hoping that Ada.Command_Line would return "/x" as Argument (1),
"/y" as Argument (2), etc.

     Is the GNAT implementation a reasonable one?  Knowing some of the
people at ACT, I suspect that they researched it fully and are doing
exactly what is expected for a DOS program.

                        Charlie

-- 
For an email response, insert "0824" between the 'c' and the 's'.



  reply	other threads:[~2007-12-19 18:00 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
2007-12-19 18:00   ` Charles H. Sampson [this message]
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-21  0:39       ` Jeffrey R. Carter
2007-12-22  0:45         ` 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-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