GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
COMMAND_LINE_ARGUMENTS
+
Point of view
All features
ANY
All features
class COMMAND_LINE_ARGUMENTS
Summary
top
An object of that class manages a command-line parsing.
Direct parents
Insert list:
ARGUMENTS
Class invariant
top
cli_argument
/= Void
Overview
top
Creation features
{
ANY
}
make
(a_argument:
COMMAND_LINE_ARGUMENT
)
Features
{
ANY
}
set_helper
(a_helper:
PROCEDURE
[
TUPLE 1
[COMMAND_LINE_ARGUMENTS]])
parse_command_line
:
BOOLEAN
usage
(stream:
OUTPUT_STREAM
)
{}
parse_argument
(a_argument:
COMMAND_LINE_ARGUMENT
):
BOOLEAN
make
(a_argument:
COMMAND_LINE_ARGUMENT
)
cli_argument
:
COMMAND_LINE_ARGUMENT
help_argument
:
COMMAND_LINE_ARGUMENT
helper
:
PROCEDURE
[
TUPLE 1
[COMMAND_LINE_ARGUMENTS]]
default_helper
(a_arguments: COMMAND_LINE_ARGUMENTS)
{
ANY
}
argument_count
:
INTEGER_32
Number of arguments given to command that started system execution (command name does not count).
argument
(i:
INTEGER_32
):
STRING
i
th argument of command that started system execution Gives the command name if
i
is 0.
command_name
:
STRING
{}
command_arguments
:
FAST_ARRAY
[
STRING
]
Give access to arguments command line including the command name at index 0.
Implementation of
ARGUMENTS
(do not use directly):
{}
se_argc
:
INTEGER_32
To implement
command_arguments
se_argv
(i:
INTEGER_32
):
STRING
To implement
command_arguments
set_helper
(a_helper:
PROCEDURE
[
TUPLE 1
[COMMAND_LINE_ARGUMENTS]])
effective procedure
{
ANY
}
top
ensure
a_helper /= Void implies
helper
= a_helper
parse_command_line
:
BOOLEAN
effective function
{
ANY
}
top
usage
(stream:
OUTPUT_STREAM
)
effective procedure
{
ANY
}
top
parse_argument
(a_argument:
COMMAND_LINE_ARGUMENT
):
BOOLEAN
effective function
{}
top
make
(a_argument:
COMMAND_LINE_ARGUMENT
)
effective procedure
{}
top
require
a_argument /= Void
ensure
cli_argument
= a_argument
cli_argument
:
COMMAND_LINE_ARGUMENT
writable attribute
{}
top
help_argument
:
COMMAND_LINE_ARGUMENT
once function
{}
top
helper
:
PROCEDURE
[
TUPLE 1
[COMMAND_LINE_ARGUMENTS]]
writable attribute
{}
top
default_helper
(a_arguments: COMMAND_LINE_ARGUMENTS)
effective procedure
{}
top
argument_count
:
INTEGER_32
effective function
{
ANY
}
top
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
}
top
i
th argument of command that started system execution Gives the command name if
i
is 0.
require
i >= 0
i <=
argument_count
ensure
Result /= Void
command_name
:
STRING
effective function
{
ANY
}
top
command_arguments
:
FAST_ARRAY
[
STRING
]
frozen
once function
{}
top
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
{}
top
To implement
command_arguments
se_argv
(i:
INTEGER_32
):
STRING
{}
top
To implement
command_arguments