comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: DOS Options
Date: Wed, 05 Dec 2007 20:06:39 GMT
Date: 2007-12-05T20:06:39+00:00	[thread overview]
Message-ID: <jxD5j.208899$kj1.128586@bgtnsc04-news.ops.worldnet.att.net> (raw)
In-Reply-To: 1i8m324.g6pon43ql1ogN%csampson@inetworld.net

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




      parent reply	other threads:[~2007-12-05 20:06 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
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-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-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 [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox