comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier <gautier@fakeaddress.nil>
Subject: Re: DOS Options
Date: Wed, 19 Dec 2007 20:40:36 +0100
Date: 2007-12-19T20:40:36+01:00	[thread overview]
Message-ID: <476973a3$1_5@news.bluewin.ch> (raw)
In-Reply-To: <1i9d4ab.twgszk4zp5evN%csampson@inetworld.net>

Charles H. Sampson:

>      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?

Sure!

> 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.

ACT doesn't support DOS since version 3.07p or maybe even before.
The last on-purpose packaged version of GNAT (specifically as a GNAT Public 
version, not a GCC version) for DOS is 3.10p.
Your 3.15p is certainly the Windows version, and what you are seeing is a Win32 
console output. Indeed, you need to congratulate Microsoft which decided to 
parse and separate the arguments in Win32 in a fashion consistent with DOS - 
adding the parsing of filenames containing spaces, enclosed by "". 
Ada.Command_Line.Argument(i) just gives the "ith" argument from the system, as 
the system wants to give it, that's it.
Running the following Turbo Pascal (authentic DOS) code:

   VAR i:Word;BEGIN FOR i:=1 TO paramcount DO WriteLn(i,':',paramstr(i))END.

you get exactly the same (expected, even if not ideal) behaviour:

C:\TEMP>show_cmd/x/y/z /a/b/c
1:/x/y/z
2:/a/b/c

HTH
______________________________________________________________
Gautier         -- http://www.mysunrise.ch/users/gdm/index.htm
Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm

NB: For a direct answer, e-mail address on the Web site!



  reply	other threads:[~2007-12-19 19:40 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
2007-12-19 19:40     ` Gautier [this message]
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-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-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