OSDN Git Service

Delete all lines containing "$Revision:".
[pf3gnuchains/gcc-fork.git] / gcc / ada / a-colire.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT RUNTIME COMPONENTS                          --
4 --                                                                          --
5 --             A D A . C O M M A N D _ L I N E . R E M O V E                --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --                                                                          --
10 --        Copyright (C) 1999 Free Software Foundation, Inc.                 --
11 --                                                                          --
12 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
13 -- terms of the  GNU General Public License as published  by the Free Soft- --
14 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
15 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
18 -- for  more details.  You should have  received  a copy of the GNU General --
19 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
20 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
21 -- MA 02111-1307, USA.                                                      --
22 --                                                                          --
23 -- As a special exception,  if other files  instantiate  generics from this --
24 -- unit, or you link  this unit with other files  to produce an executable, --
25 -- this  unit  does not  by itself cause  the resulting  executable  to  be --
26 -- covered  by the  GNU  General  Public  License.  This exception does not --
27 -- however invalidate  any other reasons why  the executable file  might be --
28 -- covered by the  GNU Public License.                                      --
29 --                                                                          --
30 -- GNAT was originally developed  by the GNAT team at  New York University. --
31 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
32 --                                                                          --
33 ------------------------------------------------------------------------------
34
35 --  This package is intended to be used in conjunction with its parent unit,
36 --  Ada.Command_Line. It provides facilities for logically removing arguments
37 --  from the command line, so that subsequent calls to Argument_Count and
38 --  Argument will reflect the removals.
39
40 --  For example, if the original command line has three arguments A B C, so
41 --  that Argument_Count is initially three, then after removing B, the second
42 --  argument, Argument_Count will be 2, and Argument (2) will return C.
43
44 package Ada.Command_Line.Remove is
45 pragma Preelaborate (Remove);
46
47    procedure Remove_Argument (Number : in Positive);
48    --  Removes the argument identified by Number, which must be in the
49    --  range 1 .. Argument_Count (i.e. an in range argument number which
50    --  reflects removals). If Number is out of range Constraint_Error
51    --  will be raised.
52    --
53    --  Note: the numbering of arguments greater than Number is affected
54    --  by the call. If you need a loop through the arguments, removing
55    --  some as you go, run the loop in reverse to avoid confusion from
56    --  this renumbering:
57    --
58    --    for J in reverse 1 .. Argument_Count loop
59    --      if Should_Remove (Arguments (J)) then
60    --        Remove_Argument (J);
61    --      end if;
62    --    end loop;
63    --
64    --  Reversing the loop in this manner avoids the confusion.
65
66    procedure Remove_Arguments (From : Positive; To : Natural);
67    --  Removes arguments in the given From..To range. From must be in the
68    --  range 1 .. Argument_Count and To in the range 0 .. Argument_Count.
69    --  Constraint_Error is raised if either argument is out of range. If
70    --  To is less than From, then the call has no effect.
71
72    procedure Remove_Argument (Argument : String);
73    --  Removes the argument which matches the given string Argument. Has
74    --  no effect if no argument matches the string. If more than one
75    --  argument matches the string, all are removed.
76
77    procedure Remove_Arguments (Argument_Prefix : String);
78    --  Removes all arguments whose prefix matches Argument_Prefix. Has
79    --  no effect if no argument matches the string. For example a call
80    --  to Remove_Arguments ("--") removes all arguments starting with --.
81
82 end Ada.Command_Line.Remove;