class CLARG_DIRECTORY
Summary
Direct parents
Inherit list: CLARG_WITH_ARG
Class invariant
Overview
Creation features
Features
{ANY}
{CLARG_PARSER}
{}
{ANY}
{COMMAND_LINE_ARGUMENTS, COMMAND_LINE_ARGUMENT}
{ANY}
  • as_mandatory: CLARG_DIRECTORY
    Make the option mandatory (default for positionals)
  • prefix "+": CLARG_DIRECTORY
    Make the option mandatory (default for positionals)
  • as_optional: CLARG_DIRECTORY
    Make the option optional (default for options)
  • prefix "-": CLARG_DIRECTORY
    Make the option optional (default for options)
{ANY}
{ANY}
{COMMAND_LINE_ARGUMENTS, COMMAND_LINE_ARGUMENT}
{}
  • parent: CLARG_DIRECTORY
    Internal technical trick to ensure that arguments with a non-standard behaviour (set_mandatory) are correctly managed.
{ANY}
{COMMAND_LINE_ARGUMENTS, COMMAND_LINE_ARGUMENT}
{}
{ANY}
parsing
{}
{CLARG_PARSER}
{}
{ANY}
{}
Implementation of ARGUMENTS (do not use directly):
{}
patterns
{}
queries
{}
usage output helpers
{}
item: DIRECTORY
writable attribute
{ANY}
The argument value, if is_set
is_set: BOOLEAN
effective function
{ANY}
True if the option is present and correct.
is_valid_data (arg: STRING): BOOLEAN
effective function
set_data (context: COMMAND_LINE_CONTEXT, arg: STRING)
effective procedure
{}
require
  • is_valid_data(arg)
ensure
  • is_set_at(context)
unset
effective procedure
{}
ensure
  • not is_set
writable attribute
{}
writable attribute
{}
is_repeatable: BOOLEAN
is False
constant attribute
{ANY}
True if the argument is repeatable; False if unique.
prepare_parse
effective procedure
ensure
  • not is_set
is_set_at (context: COMMAND_LINE_CONTEXT): BOOLEAN
effective function
True if the option is present and correct at the given context.
require
  • context.is_parsed
ensure
  • Result implies is_set
  • not is_repeatable implies Result = is_set
undo_parse (context: COMMAND_LINE_CONTEXT)
effective procedure
require
  • is_set_at(context)
ensure
  • not is_set_at(context)
  • not is_repeatable implies not is_set
as_mandatory: CLARG_DIRECTORY
effective function
{ANY}
Make the option mandatory (default for positionals)
require ensure
prefix "+": CLARG_DIRECTORY
effective function
{ANY}
Make the option mandatory (default for positionals)
require ensure
as_optional: CLARG_DIRECTORY
effective function
{ANY}
Make the option optional (default for options)
require ensure
prefix "-": CLARG_DIRECTORY
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: CLARG_DIRECTORY, enable: BOOLEAN)
deferred procedure
require ensure
parent: CLARG_DIRECTORY
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
require
  • context.is_parsed
usage_summary (stream: OUTPUT_STREAM)
deferred procedure
ensure
usage_details (stream: OUTPUT_STREAM)
deferred procedure
ensure
detailed: BOOLEAN
deferred function
{}
writable attribute
{ANY}
index: INTEGER_32
writable attribute
{ANY}
out_in_tagged_out_memory
effective procedure
{ANY}
Append terse printable representation of current object in tagged_out_memory.
require
    • locked: tagged_out_locked
    • locked: tagged_out_locked
ensure
  • still_locked: tagged_out_locked
  • not_cleared: tagged_out_memory.count >= old tagged_out_memory.count
  • append_only: old tagged_out_memory.twin.is_equal(tagged_out_memory.substring(1, old tagged_out_memory.count))
parse_positional (context: COMMAND_LINE_CONTEXT): COMMAND_LINE_CONTEXT
effective function
{}
require
effective function
{}
require
effective function
{}
require
set_data_ (context: COMMAND_LINE_CONTEXT, data: STRING)
effective procedure
require
optional (a_short: ABSTRACT_STRING, a_long: ABSTRACT_STRING, a_name: ABSTRACT_STRING, a_usage: ABSTRACT_STRING)
effective procedure
{}
require
  • a_short /= Void implies a_short.count = 1
  • a_short /= Void or else a_long /= Void
  • a_name /= Void
ensure
  • is_optional
  • a_short /= Void implies short.is_equal(a_short)
  • a_long /= Void implies long.is_equal(a_long)
  • name.is_equal(a_name)
  • a_usage /= Void implies usage.is_equal(a_usage)
positional (a_name: ABSTRACT_STRING, a_usage: ABSTRACT_STRING)
effective procedure
{}
require
  • a_name /= Void
ensure
argument_count: INTEGER_32
effective function
{ANY}
Number of arguments given to command that started system execution (command name does not count).
ensure
  • Result >= 0
argument (i: INTEGER_32): STRING
effective function
{ANY}
i th argument of command that started system execution Gives the command name if i is 0.
require ensure
  • Result /= Void
command_name: STRING
effective function
{ANY}
command_arguments: FAST_ARRAY[STRING]
frozen
once function
{}
Give access to arguments command line including the command name at index 0.
This is a once function, so you can modify command-line arguments! (NOTE: just be sure not to remove the first argument, although you may change it)
ensure
  • not Result.is_empty
se_argc: INTEGER_32
{}
To implement command_arguments
se_argv (i: INTEGER_32): STRING
{}
To implement command_arguments
short_pattern: REGULAR_EXPRESSION
once function
{}
long_pattern: REGULAR_EXPRESSION
once function
{}
long_equal_pattern: REGULAR_EXPRESSION
once function
{}
is_short (arg: STRING, a_index: INTEGER_32): BOOLEAN
effective function
{}
require
is_long (arg: STRING): BOOLEAN
effective function
{}
require
is_long_equal (arg: STRING): BOOLEAN
effective function
{}
require ensure
put_short (stream: OUTPUT_STREAM)
effective procedure
{}
require
put_long (stream: OUTPUT_STREAM)
effective procedure
{}
require