This package provides parser of command line arguments.
procedure Add_Option
(Self : in out Command_Line_Parser'Class;
Option : Abstract_Option'Class)
Add command line option.
type Command_Line_Parser is tagged limited private;
function Error_Message
(Self : Command_Line_Parser'Class) return VSS.Strings.Virtual_String
Return error message if any.
function Help_Text
(Self : Command_Line_Parser'Class)
return VSS.String_Vectors.Virtual_String_Vector
Construct description of all registered options and returns it.
function Is_Specified
(Self : Command_Line_Parser'Class;
Option : Abstract_Option'Class) return Boolean
Return True when given option has been specified the command line.
function Parse
(Self : in out Command_Line_Parser'Class;
Arguments : VSS.String_Vectors.Virtual_String_Vector) return Boolean
Parse given arguments. Return True on success, otherwise return False and set error message that can be retrieved with Error_Message subprogram.
function Positional_Arguments
(Self : Command_Line_Parser'Class)
return VSS.String_Vectors.Virtual_String_Vector
Return list of positional arguments.
function Unknown_Option_Arguments
(Self : Command_Line_Parser'Class)
return VSS.String_Vectors.Virtual_String_Vector
Return list of undefined options found in the list of arguments.
function Value
(Self : Command_Line_Parser'Class;
Option : Positional_Option'Class) return VSS.Strings.Virtual_String
Return value of the given option.
function Value
(Self : Command_Line_Parser'Class;
Option : Value_Option'Class) return VSS.Strings.Virtual_String
Return value of the given option.
function Values
(Self : Command_Line_Parser'Class;
Option : Name_Value_Option'Class) return Name_Value_Vectors.Vector
Return all name=value pairs of the given option specified in the command line.
function Values
(Self : Command_Line_Parser'Class;
Option : Value_Option'Class)
return VSS.String_Vectors.Virtual_String_Vector
Return all values of the given option specified in the command line.