DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T V

⟦cef995a3e⟧ TextFile

    Length: 5737 (0x1669)
    Types: TextFile
    Names: »V«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with String_Pkg;
use String_Pkg;

--------------------------------------------------------------------

package Command_Line_Interface is
    --| Provides primitives for getting at the command line arguments.

    --| Overview
    --| This package provides a universal and portable interface to
    --| the arguments typed on a command line when a program is invoked.
    --| Each command line argument is either a Word (sequence of non-blank
    --| characters) or a quoted string, with embedded quotes doubled.
    --|
    --| Both named and positional arguments may be given on the command
    --| line.  However, once a named parameter is used, all the subseqent
    --| parameters on the command line must be named parameters.  For example,
    --| the commands
    --|-
    --|     compile  abc pqr xyz library => plib
    --|     compile  abc,pqr,unit=>xyz,library=>plib
    --|+
    --| have one named argument and three positional arguments.  This
    --| package separates the named parameters from the positional
    --| parameters, ignores spaces around the "bound to" (=>) symbol, and
    --| allows parameters to be separated by either spaces or commas,
    --| so these command lines are indistinguishable.
    --|
    --| At program elaboration time, the command line string is automatically
    --| obtained from the host operating system and parsed into
    --| individual arguments.  The following operations may then be used:
    --|-
    --| Named_arg_count()  Returns number of named arguments entered
    --| Positional_arg_count() Returns number of positional arguments
    --| Positional_arg_value(N) Returns the Nth positional argument
    --| Named_arg_value(Name, Fnd, val) Returns value of a named argument
    --| Arguments()   Returns the entire command line
    --|+

    ----------------------------------------------------------------

    Max_Args : constant := 255;
    --| Maximum number of command line arguments (arbitrary).

    subtype Argument_Count is Integer range 0 .. Max_Args;
    --| For number of arguments
    subtype Argument_Index is Argument_Count range 1 .. Argument_Count'Last;
    --| Used to number the command line arguments.

    No_Arg : exception;
    --| Raised when request made for nonexistent argument

    Missing_Positional_Arg : exception;
    --| Raised when command line is missing positional argument (A,,B)

    Invalid_Named_Association : exception;
    --| Raised when command line is missing named argument value (output=> ,A,B)

    Unreferenced_Named_Arg : exception;
    --| Raised when not all named parameters have been retrieved

    Invalid_Parameter_Order : exception;
    --| Raised when a positional parameter occurs after a named parameter
    --  in the command line

    ----------------------------------------------------------------

    procedure Initialize ( --| Initializes command_line_interface
                          Arg_String : in String);

    --| N/A: modifies, errors, raises

    ---------------------------------------------------------------------

    function Named_Arg_Count --| Return number of named arguments
                return Argument_Count;
    --| N/A: modifies, errors, raises


    function Positional_Arg_Count --| Return number of positional arguments
                return Argument_Count;
    --| N/A: modifies, errors, raises


    ----------------------------------------------------------------

    function Positional_Arg_Value ( --| Return an argument value
                                   N : in Argument_Index
                                   --| Position of desired argument
                                   ) return String;  --| Raises: no_arg

    --| Effects: Return the Nth argument.  If there is no argument at
    --| position N, no_arg is raised.

    --| N/A: modifies, errors


    function Positional_Arg_Value ( --| Return an argument value
                                   N : in Argument_Index
                                   --| Position of desired argument
                                   ) return String_Type;  --| Raises: no_arg

    --| Effects: Return the Nth argument.  If there is no argument at
    --| position N, no_arg is raised.

    --| N/A: modifies, errors

    --------------------------------------------------------------------

    procedure Named_Arg_Value ( --| Return a named argument value
                               Name : in String;
                               Found : out Boolean;
                               Arg_Value : out String);

    --| Effects: Return the value associated with Name on the command
    --| line.  If there was none, return Default.

    --| N/A: modifies, errors


    procedure Named_Arg_Value ( --| Return a named argument value
                               Name : in String;
                               Found : out Boolean;
                               Arg_Value : out String_Type);

    --| Effects: Return the value associated with Name on the command
    --| line.  If there was none, return Default.

    --| N/A: modifies, errors

    ----------------------------------------------------------------

    function Arguments --| Return the entire argument string
                return String;
    --| Effects: Return the entire command line, except for the name
    --| of the command itself.

    --| N/A: modifies, errors, raises

    ----------------------------------------------------------------

    procedure Finalize;  --| Raises: unrecognized parameters

    --| Effects: If not all named parameters have been retrieved
    --| unrecognized parameters is raised.
    --| N/A: modifies, errors

end Command_Line_Interface;

----------------------------------------------------------------