deferred class COMMAND_LINE_TYPED_ARGUMENT [E_]
Summary
A "single" argument which bears a value aka item.
Direct parents
Inherit list: COMMAND_LINE_ARGUMENT
Known children
Inherit list: CLARG_BOOLEAN, CLARG_COUNTER, CLARG_REMAINING, CLARG_WITH_ARG, CLARG_WITH_ARGS
Class invariant
Overview
Features
{ANY}
  • item: E_
    The argument value, if is_set
  • as_mandatory: COMMAND_LINE_TYPED_ARGUMENT [E_]
    Make the option mandatory (default for positionals)
  • prefix "+": COMMAND_LINE_TYPED_ARGUMENT [E_]
    Make the option mandatory (default for positionals)
  • as_optional: COMMAND_LINE_TYPED_ARGUMENT [E_]
    Make the option optional (default for options)
  • prefix "-": COMMAND_LINE_TYPED_ARGUMENT [E_]
    Make the option optional (default for options)
{ANY}
{ANY}
{COMMAND_LINE_ARGUMENTS, COMMAND_LINE_ARGUMENT}
{}
  • parent: COMMAND_LINE_TYPED_ARGUMENT [E_]
    Internal technical trick to ensure that arguments with a non-standard behaviour (set_mandatory) are correctly managed.
{ANY}
{ANY}
{COMMAND_LINE_ARGUMENTS, COMMAND_LINE_ARGUMENT}
{}
item: E_
deferred function
{ANY}
The argument value, if is_set
as_mandatory: COMMAND_LINE_TYPED_ARGUMENT [E_]
effective function
{ANY}
Make the option mandatory (default for positionals)
require ensure
prefix "+": COMMAND_LINE_TYPED_ARGUMENT [E_]
effective function
{ANY}
Make the option mandatory (default for positionals)
require ensure
as_optional: COMMAND_LINE_TYPED_ARGUMENT [E_]
effective function
{ANY}
Make the option optional (default for options)
require ensure
prefix "-": COMMAND_LINE_TYPED_ARGUMENT [E_]
effective function
{ANY}
Make the option optional (default for options)
require ensure
is_mandatory: BOOLEAN
deferred function
{ANY}
True if the argument must be set at least once.
ensure
is_optional: BOOLEAN
deferred function
{ANY}
True if the argument may not be set.
ensure
is_positional: BOOLEAN
deferred function
{ANY}
True if the argument is not introduced by a flag.
Such an argument is mandatory and may have an explicit position on the command line (see force_index).
ensure
can_be_mandatory: BOOLEAN
deferred function
{ANY}
True if the argument can be set_mandatory(True).
can_be_optional: BOOLEAN
deferred function
{ANY}
True if the argument can be set_mandatory(False).
short: FIXED_STRING
deferred function
{ANY}
The short (one-letter) option flag introducing the argument, Void for positionals
ensure
  • is_positional implies Result = Void
  • Result /= Void implies Result.count = 1
deferred function
{ANY}
The long option flag introducing the argument, Void for positionals
ensure
  • is_positional implies Result = Void
  • Result /= Void implies not Result.is_empty
usage: FIXED_STRING
deferred function
{ANY}
The option usage
force_index (a_index: INTEGER_32)
deferred procedure
{ANY}
Force a positional parameter to be valid only at the given index
require
set_mandatory (parent_option: COMMAND_LINE_TYPED_ARGUMENT [E_], enable: BOOLEAN)
deferred procedure
require ensure
parent: COMMAND_LINE_TYPED_ARGUMENT [E_]
deferred function
{}
Internal technical trick to ensure that arguments with a non-standard behaviour (set_mandatory) are correctly managed.
effective function
{ANY}
Arguments disjunction.
Useful to implement mutually exclusive sets of arguments.
require
  • other /= Void
ensure
  • Result /= Void
infix "or else" (other: COMMAND_LINE_ARGUMENT): COMMAND_LINE_ARGUMENT
effective function
{ANY}
Arguments disjunction.
Useful to implement mutually exclusive sets of arguments.
require
  • other /= Void
ensure
  • Result /= Void
effective function
{ANY}
Arguments conjunction.
All the arguments are checked, in any order.
require
  • other /= Void
ensure
  • Result /= Void
infix "and then" (other: COMMAND_LINE_ARGUMENT): COMMAND_LINE_ARGUMENT
effective function
{ANY}
Arguments conjunction.
All the arguments are checked, in any order.
require
  • other /= Void
ensure
  • Result /= Void
prefix "not": COMMAND_LINE_ARGUMENT
effective function
{ANY}
(tentative; don't use it, the semantics is not well defined)
ensure
  • Result /= Void
is_set: BOOLEAN
deferred function
{ANY}
True if the option is present and correct.
is_repeatable: BOOLEAN
deferred function
{ANY}
True if the argument is repeatable; False if unique.
prepare_parse
deferred procedure
ensure
require
  • context.is_parsed
undo_parse (context: COMMAND_LINE_CONTEXT)
deferred procedure
require ensure
True if the option is present and correct at the given context.
require
  • context.is_parsed
ensure
usage_summary (stream: OUTPUT_STREAM)
deferred procedure
ensure
usage_details (stream: OUTPUT_STREAM)
deferred procedure
ensure
detailed: BOOLEAN
deferred function
{}