VSS.Command_Line

Entities

Record Types

Tagged Types

Subprograms

Generic Instantiations

Description

This package provides access to command line arguments as parsed options.

Abstract_Option

type Abstract_Option is abstract tagged record
   Description : VSS.Strings.Virtual_String;
end record;
Record fields
Description

Add_Help_Option

procedure Add_Help_Option

Adds builtin definition of the option to display help information. This option is handled automatically.

Add_Option

procedure Add_Option (Option : Abstract_Option'Class)
Parameters
Option

Binary_Option

type Binary_Option is new Named_Option with null record;

Is_Specified

function Is_Specified (Option : Abstract_Option'Class) return Boolean

Return True when given option has been specified the command line.

Parameters
Option
Return Value

Name_Value

type Name_Value is record
   Name  : VSS.Strings.Virtual_String;
   Value : VSS.Strings.Virtual_String;
end record;
Record fields
Name
Value

Name_Value_Option

type Name_Value_Option is new Named_Option with record
   Name_Name  : VSS.Strings.Virtual_String;
   Value_Name : VSS.Strings.Virtual_String;
end record;
Record fields
Name_Name
Value_Name

Name_Value_Vectors

package Name_Value_Vectors is
   new Ada.Containers.Vectors (Positive, Name_Value);

Named_Option

type Named_Option is abstract new Abstract_Option with record
   Short_Name : VSS.Strings.Virtual_String;
   Long_Name  : VSS.Strings.Virtual_String;
end record;
Record fields
Short_Name
Long_Name

Positional_Arguments

function Positional_Arguments
  return VSS.String_Vectors.Virtual_String_Vector

Return list of positional arguments.

Return Value

Positional_Option

type Positional_Option is new Abstract_Option with record
   Name : VSS.Strings.Virtual_String;
end record;
Record fields
Name

Process

procedure Process

Parse command line. If error is found then report it and terminate application.

Report_Error

procedure Report_Error (Message : VSS.String_Vectors.Virtual_String_Vector)

Report error and terminate application.

Parameters
Message

Report_Error

procedure Report_Error (Message : VSS.Strings.Virtual_String)

Report error and terminate application.

Parameters
Message

Value

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

Return value of the given option.

Parameters
Option
Return Value

Value

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

Return value of the given option.

Parameters
Option
Return Value

Value_Option

type Value_Option is new Named_Option with record
   Value_Name : VSS.Strings.Virtual_String;
end record;
Record fields
Value_Name

Values

function Values
  (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
Option
Return Value

Values

function Values
  (Option : Value_Option'Class)
   return VSS.String_Vectors.Virtual_String_Vector

Return all values of the given option specified in the command line.

Parameters
Option
Return Value