Ada Class Library Analyse command line
More...Help_GNU | |
Help_Short | |
Option_Argument | |
Option_Error | |
Option_Marker |
FoundFlag |
Object |
Put_Help_Line | |
Put_Help_Line | |
Put_Help_Line | |
Put_Help_Line | |
Put_Help_Line |
Analyze_File | |
Analyze_GNU | |
Analyze_WithArgument | |
Analyze_WithoutArgument | |
Get_Argument | |
Get_ExtractGNU | |
Get_GNUOption | |
Get_Optind | |
Get_Option | |
Get_Pattern | |
Next | |
Parse | |
Set_ExceptionOnError | |
Set_ExtractGNU | |
Set_Pattern | |
WriteHelp |
Unbounded |
A modern object oriented version of GetOpt made for Ada - that's without the C style ugliness. Also, unlike for example GNAT.Command_Line this package is re-entrant. All internal states are kept inside the class instance so two tasks can parse the command line in parallel. Last not least this command line parser has wide character support for short options, long options and file names.
81 | Help_GNU : constant Wide_Wide_String; |
---|
GNU Option to request Help
86 | Help_Short : constant Wide_Wide_Character; |
---|
Short Option to request Help
96 | Option_Argument : constant Wide_Wide_Character; |
---|
Options with Arguments.
91 | Option_Error : constant Wide_Wide_Character; |
---|
Flags an Error, unknown options are errors
101 | Option_Marker : constant Wide_Wide_Character; |
---|
Character with which all options start
70 | type FoundFlag is |
---|---|
71 | (EndOfOptions, |
72 | NoOption, |
73 | GNU_Style, |
74 | WithArgument, |
75 | WithoutArgument, |
76 | Error); |
Return values. The C version had only two states: -1 error, > 0 option character.
no more options
no option
GNU style option
option with argument
option without argument
parser encountered error
60 | type Object is tagged private; |
---|
internale data
159 | procedure Put_Help_Line (Evironment_Variable : String); |
---|
Print a help line
Name of alternative environment variable.
166 | procedure Put_Help_Line (Long : Wide_Wide_String; Description : Wide_Wide_String) with |
---|---|
167 | Pre => (Long'Length < 20); |
Print a help line
Long GNU style option
description of option
175 | procedure Put_Help_Line |
---|---|
176 | (Short : Wide_Wide_Character; |
177 | Long : Wide_Wide_String; |
178 | Description : Wide_Wide_String) with |
179 | Pre => (Long'Length < 20); |
Print a help line
Short option
Long GNU style option
description of option
187 | procedure Put_Help_Line |
---|---|
188 | (Long : Wide_Wide_String; |
189 | Option : Wide_Wide_String; |
190 | Description : Wide_Wide_String) with |
191 | Pre => (Option'Length + 1 < 10) and then (Long'Length + Option'Length + 1 < 20); |
Print a help line
Long GNU style option
parameter for option
description of option
200 | procedure Put_Help_Line |
---|---|
201 | (Short : Wide_Wide_Character; |
202 | Long : Wide_Wide_String; |
203 | Option : Wide_Wide_String; |
204 | Description : Wide_Wide_String) with |
205 | Pre => (Option'Length + 1 < 10) and then (Long'Length + Option'Length + 1 < 20); |
Print a help line
Short option
Long GNU style option
parameter for option
description of option
153 | procedure Analyze_File (This : in out Object); |
---|
A File was found on the command line
the Object itself
147 | procedure Analyze_GNU (This : in out Object); |
---|
A GNU Style was found on the command line
the Object itself
141 | procedure Analyze_WithArgument (This : in out Object); |
---|
A Classic Style Option with Argument was found on the command line
the Object itself
135 | procedure Analyze_WithoutArgument (This : in out Object); |
---|
A Classic Style Option without Argument was found on the command line
the Object itself
224 | function Get_Argument (This : in Object) return Wide_Wide_String with |
---|---|
225 | Inline; |
Last Argument Option Found.
Object itself.
272 | function Get_ExtractGNU (This : in Object) return Boolean with |
---|---|
273 | Inline; |
Get GNU Option extraction flag. GNU-Options start with "--" and have the Format --option=argument.
Object itself.
True if GNU options are parsed.
240 | function Get_GNUOption (This : in Object) return Wide_Wide_String with |
---|---|
241 | Inline; |
Last GNU-Option Found.
Object itself.
GNU option found.
217 | function Get_Optind (This : in Object) return Positive with |
---|---|
218 | Inline; |
Nr of Last Option processed
Object itself.
232 | function Get_Option (This : in Object) return Wide_Wide_Character with |
---|---|
233 | Inline; |
Last Single Character Option Found.
Object itself.
Option found.
248 | function Get_Pattern (This : in Object) return Wide_Wide_String with |
---|---|
249 | Inline; |
Get Format string. The usual mix of options and ':'
Object itself.
currently used pattern.
123 | procedure Next (This : in out Object; Found : out FoundFlag); |
---|
get next Option.
Object itself.
Result of the Next command
129 | procedure Parse (This : in out Object); |
---|
Start Parsing the command line.
the Object itself
264 | procedure Set_ExceptionOnError (This : in out Object; ExceptionOnError : in Boolean := True) with |
---|---|
265 | Inline; |
Set error handling on or off
Object itself.
when true raise exception on error else return option ':' or '?'
280 | procedure Set_ExtractGNU (This : in out Object; ExtractGNU : in Boolean := True) with |
---|---|
281 | Inline; |
Set GNU Option extraction flag. GNU-Options start with "--" and have the Format --option=argument.
Object itself.
When true, gnu options are extracted.
256 | procedure Set_Pattern (This : in out Object; Pattern : in Wide_Wide_String) with |
---|---|
257 | Inline; |
Set Format string. The usual mix of options and ':'
Object itself.
Pattern to parse.
211 | procedure WriteHelp (This : in out Object); |
---|
A Call for Help was found on the command line
the Object itself