From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,502b8ae4630fba59 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 19 Dec 2007 20:40:36 +0100 From: Gautier User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: DOS Options References: <1i8m324.g6pon43ql1ogN%csampson@inetworld.net> <1i9d4ab.twgszk4zp5evN%csampson@inetworld.net> In-Reply-To: <1i9d4ab.twgszk4zp5evN%csampson@inetworld.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 83.76.177.87 X-Original-NNTP-Posting-Host: 83.76.177.87 Message-ID: <476973a3$1_5@news.bluewin.ch> X-Trace: news.bluewin.ch 1198093219 83.76.177.87 (19 Dec 2007 20:40:19 +0100) Organization: Bluewin AG Complaints-To: abuse@bluewin.ch X-Original-NNTP-Posting-Host: 127.0.0.1 Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!164.128.36.58!news.ip-plus.net!newsfeed.ip-plus.net!news.bluewin.ch!not-for-mail Xref: g2news1.google.com comp.lang.ada:19003 Date: 2007-12-19T20:40:36+01:00 List-Id: 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!