1
-- Topal: GPG/GnuPG and Alpine/Pine integration
2
-- Copyright (C) 2001--2008 Phillip J. Brooke
4
-- This program is free software: you can redistribute it and/or modify
5
-- it under the terms of the GNU General Public License version 3 as
6
-- published by the Free Software Foundation.
8
-- This program is distributed in the hope that it will be useful,
9
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
10
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
-- GNU General Public License for more details.
13
-- You should have received a copy of the GNU General Public License
14
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
6
16
with Globals; use Globals;
8
18
package Command_Line_Wrapper is
10
20
Argument_Overrun : exception;
12
22
-- Three functions for working through the command line.
13
23
-- The first only advances the pointer if the test was true.
14
24
-- Two forms, one taking a string, one taking a UBS_Array.
15
25
function Match (A : in String) return Boolean;
17
27
function Match (A : in UBS_Array) return Boolean;
19
29
-- This second function always advances.
20
30
function Eat return UBS;
22
32
-- This last function returns true if there is still something to read.
23
33
function More (Needed : Positive := 1) return Boolean;
25
35
-- Given J, the index of the first command line argument to drop into an
26
36
-- array, drop J, J+1, etc. into an array and return it.
27
37
function Eat_Remaining_Arguments return UBS_Array_Pointer;