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!news3.google.com!out03b.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!cycny01.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny06.POSTED!c9e1c1fe!not-for-mail From: Jeffrey Creem 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> In-Reply-To: <1i8m324.g6pon43ql1ogN%csampson@inetworld.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Wed, 05 Dec 2007 05:15:01 GMT NNTP-Posting-Host: 71.168.122.204 X-Complaints-To: abuse@verizon.net X-Trace: trndny06 1196831701 71.168.122.204 (Wed, 05 Dec 2007 00:15:01 EST) NNTP-Posting-Date: Wed, 05 Dec 2007 00:15:01 EST Xref: g2news1.google.com comp.lang.ada:18714 Date: 2007-12-05T05:15:01+00:00 List-Id: 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.