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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn14feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: DOS Options Reply-To: anon@anon.org (anon) References: <1i8m324.g6pon43ql1ogN%csampson@inetworld.net> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Wed, 05 Dec 2007 20:06:39 GMT NNTP-Posting-Host: 12.64.152.227 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1196885199 12.64.152.227 (Wed, 05 Dec 2007 20:06:39 GMT) NNTP-Posting-Date: Wed, 05 Dec 2007 20:06:39 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:18733 Date: 2007-12-05T20:06:39+00:00 List-Id: -- -- c.adb -- -- -- Sample run: -- c/f -- Yields: -- Command_Name => c -- Argument ( 1 ) => /f -- with Ada.Integer_Text_IO ; use Ada.Integer_Text_IO ; with Ada.Text_IO ; use Ada.Text_IO ; With Ada.Command_Line ; use Ada.Command_Line ; procedure c is begin -- Argument ( 0 ) Put ( "Command => " ) ; Put_Line ( Command_Name ) ; -- Argument ( 1..?? ) if Argument_Count = 0 then Put_Line ( "No command options" ) ; else Put_Line ( "Command options" ) ; for Index in 1..Argument_Count loop Put ( " " ) ; Put ( Index ) ; Put ( " => " ) ; Put_Line ( Argument ( Index ) ) ; end loop ; end if ; end c ; In <1i8m324.g6pon43ql1ogN%csampson@inetworld.net>, csampson@inetworld.net (Charles H. Sampson) writes: > 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 > >-- >For an email response, insert "0824" between the 'c' and the 's'.