1 | ----------------------------------------------------------------------------- |
---|---|
2 | -- |
3 | -- Copyright 2004 Björn Persson. |
4 | -- |
5 | -- This library is free software; you can redistribute it and/or modify it |
6 | -- under the terms of the GNU General Public License, version 2, as published |
7 | -- by the Free Software Foundation. |
8 | -- |
9 | -- As a special exception, if other files instantiate generics from this |
10 | -- unit, or you link this unit with other files to produce an executable, |
11 | -- this unit does not by itself cause the resulting executable to be covered |
12 | -- by the General Public License. This exception does not however invalidate |
13 | -- any other reasons why the executable file might be covered by the General |
14 | -- Public License. |
15 | -- |
16 | ---------------------------------------------------------------------------- |
17 | |
18 | pragma License (Modified_Gpl); |
19 | pragma Ada_2022; |
20 | |
21 | with Ada.Command_Line; |
22 | |
23 | package AdaCL.EAstrings.OS.Command_Line is |
24 | -- |
25 | -- This package allows a program to obtain the values of its arguments and |
26 | -- the name that it was invoked with in an encoding-aware way. It is |
27 | -- assumed that the command name and the arguments are encoded in the |
28 | -- encoding that OS.OS_Encoding reports. |
29 | -- |
30 | |
31 | pragma Elaborate_Body; |
32 | |
33 | function Argument_Count return Natural renames |
34 | Ada.Command_Line.Argument_Count; |
35 | -- Returns the number of strings passed as arguments to the program. |
36 | |
37 | function Argument (Number : in Positive) return EAstring; |
38 | -- Returns the argument at position Number. If Number is outside the range |
39 | -- 1..Argument_Count, then Constraint_Error is propagated. |
40 | |
41 | function Command_Name return EAstring; |
42 | -- Returns the name of the command that invoked the program. |
43 | |
44 | end AdaCL.EAstrings.OS.Command_Line; |