VSS.Command_Line.Parsers

Entities

Tagged Types

Subprograms

Description

This package provides parser of command line arguments.

Add_Option

procedure Add_Option
  (Self   : in out Command_Line_Parser'Class;
   Option : Abstract_Option'Class)

Add command line option.

Parameters
Self
Option

Command_Line_Parser

type Command_Line_Parser is tagged limited private;

Error_Message

function Error_Message
  (Self : Command_Line_Parser'Class) return VSS.Strings.Virtual_String

Return error message if any.

Parameters
Self
Return Value

Help_Text

function Help_Text
  (Self : Command_Line_Parser'Class)
   return VSS.String_Vectors.Virtual_String_Vector

Construct description of all registered options and returns it.

Parameters
Self
Return Value

Is_Specified

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.

Parameters
Self
Option
Return Value

Parse

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.

Parameters
Self
Arguments
Return Value

Positional_Arguments

function Positional_Arguments
  (Self : Command_Line_Parser'Class)
   return VSS.String_Vectors.Virtual_String_Vector

Return list of positional arguments.

Parameters
Self
Return Value

Unknown_Option_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.

Parameters
Self
Return Value

Value

function Value
  (Self   : Command_Line_Parser'Class;
   Option : Positional_Option'Class) return VSS.Strings.Virtual_String

Return value of the given option.

Parameters
Self
Option
Return Value

Value

function Value
  (Self   : Command_Line_Parser'Class;
   Option : Value_Option'Class) return VSS.Strings.Virtual_String

Return value of the given option.

Parameters
Self
Option
Return Value

Values

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.

Parameters
Self
Option
Return Value

Values

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.

Parameters
Self
Option
Return Value