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 Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.nethere.com!news.nethere.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 19 Dec 2007 12:00:52 -0600 Newsgroups: comp.lang.ada Subject: Re: DOS Options From: csampson@inetworld.net (Charles H. Sampson) Date: Wed, 19 Dec 2007 10:00:52 -0800 Message-ID: <1i9d4ab.twgszk4zp5evN%csampson@inetworld.net> References: <1i8m324.g6pon43ql1ogN%csampson@inetworld.net> User-Agent: MacSOUP/2.8.2 (Mac OS X version 10.4.11 (PPC)) X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 75.33.10.54 X-Trace: sv3-s69ON3kmVb7Mj/BN1uuVJfw4rmim5a5RsjNaWx4e9sfIwYot7kbwZr1mrdj3O+VUpqmAenHczSiIPFl!iQA2FcuJSBlI0Zh2snKJl1M2J5SSY68UovS0eAMKUUDLEu9v5Ll2Bn6+tzR8Jyrhoc04ngKlEsXU!khB4knzvBdoUQoygKKmx98UH2Q== X-Complaints-To: abuse@nethere.com X-DMCA-Complaints-To: abuse@nethere.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.37 Xref: g2news1.google.com comp.lang.ada:19002 Date: 2007-12-19T10:00:52-08:00 List-Id: Jeffrey Creem 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'.