|
| def | __init__ (self, usage, name=None, version=None, arg_limits=None, validator=None, env_options=None, auto_help=True, auto_version=True, auto_pythonpath='DEPRECATED', auto_argumentfile=True) |
| | Available options and tool name are read from the usage. More...
|
| |
| def | parse_args (self, args) |
| | Parse given arguments and return options and positional arguments. More...
|
| |
|
| def | _create_option (self, short_opts, long_opt, takes_arg, is_multi) |
| |
| def | _create_options (self, usage) |
| |
| def | _get_default_opts (self) |
| |
| def | _get_env_options (self) |
| |
| def | _get_name (self, name) |
| |
| def | _get_pythonpath (self, paths) |
| |
| def | _glob_args (self, args) |
| |
| def | _handle_special_options (self, opts, args) |
| |
| def | _lowercase_long_option (self, opt) |
| |
| def | _parse_args (self, args) |
| |
| def | _process_opts (self, opt_tuple) |
| |
| def | _process_possible_argfile (self, args) |
| |
| def | _raise_help (self) |
| |
| def | _raise_option_multiple_times_in_usage (self, opt) |
| |
| def | _raise_version (self) |
| |
| def | _split_pythonpath (self, paths) |
| |
| def | _verify_long_not_already_used (self, opt, flag=False) |
| |
Definition at line 47 of file argumentparser.py.
◆ __init__()
| def robot.utils.argumentparser.ArgumentParser.__init__ |
( |
|
self, |
|
|
|
usage, |
|
|
|
name = None, |
|
|
|
version = None, |
|
|
|
arg_limits = None, |
|
|
|
validator = None, |
|
|
|
env_options = None, |
|
|
|
auto_help = True, |
|
|
|
auto_version = True, |
|
|
|
auto_pythonpath = 'DEPRECATED', |
|
|
|
auto_argumentfile = True |
|
) |
| |
Available options and tool name are read from the usage.
Tool name is got from the first row of the usage. It is either the
whole row or anything before first ' -- '.
Definition at line 64 of file argumentparser.py.
◆ _create_option()
| def robot.utils.argumentparser.ArgumentParser._create_option |
( |
|
self, |
|
|
|
short_opts, |
|
|
|
long_opt, |
|
|
|
takes_arg, |
|
|
|
is_multi |
|
) |
| |
|
private |
◆ _create_options()
| def robot.utils.argumentparser.ArgumentParser._create_options |
( |
|
self, |
|
|
|
usage |
|
) |
| |
|
private |
◆ _get_default_opts()
| def robot.utils.argumentparser.ArgumentParser._get_default_opts |
( |
|
self | ) |
|
|
private |
◆ _get_env_options()
| def robot.utils.argumentparser.ArgumentParser._get_env_options |
( |
|
self | ) |
|
|
private |
◆ _get_name()
| def robot.utils.argumentparser.ArgumentParser._get_name |
( |
|
self, |
|
|
|
name |
|
) |
| |
|
private |
◆ _get_pythonpath()
| def robot.utils.argumentparser.ArgumentParser._get_pythonpath |
( |
|
self, |
|
|
|
paths |
|
) |
| |
|
private |
◆ _glob_args()
| def robot.utils.argumentparser.ArgumentParser._glob_args |
( |
|
self, |
|
|
|
args |
|
) |
| |
|
private |
◆ _handle_special_options()
| def robot.utils.argumentparser.ArgumentParser._handle_special_options |
( |
|
self, |
|
|
|
opts, |
|
|
|
args |
|
) |
| |
|
private |
◆ _lowercase_long_option()
| def robot.utils.argumentparser.ArgumentParser._lowercase_long_option |
( |
|
self, |
|
|
|
opt |
|
) |
| |
|
private |
◆ _parse_args()
| def robot.utils.argumentparser.ArgumentParser._parse_args |
( |
|
self, |
|
|
|
args |
|
) |
| |
|
private |
◆ _process_opts()
| def robot.utils.argumentparser.ArgumentParser._process_opts |
( |
|
self, |
|
|
|
opt_tuple |
|
) |
| |
|
private |
◆ _process_possible_argfile()
| def robot.utils.argumentparser.ArgumentParser._process_possible_argfile |
( |
|
self, |
|
|
|
args |
|
) |
| |
|
private |
◆ _raise_help()
| def robot.utils.argumentparser.ArgumentParser._raise_help |
( |
|
self | ) |
|
|
private |
◆ _raise_option_multiple_times_in_usage()
| def robot.utils.argumentparser.ArgumentParser._raise_option_multiple_times_in_usage |
( |
|
self, |
|
|
|
opt |
|
) |
| |
|
private |
◆ _raise_version()
| def robot.utils.argumentparser.ArgumentParser._raise_version |
( |
|
self | ) |
|
|
private |
◆ _split_pythonpath()
| def robot.utils.argumentparser.ArgumentParser._split_pythonpath |
( |
|
self, |
|
|
|
paths |
|
) |
| |
|
private |
◆ _verify_long_not_already_used()
| def robot.utils.argumentparser.ArgumentParser._verify_long_not_already_used |
( |
|
self, |
|
|
|
opt, |
|
|
|
flag = False |
|
) |
| |
|
private |
◆ parse_args()
| def robot.utils.argumentparser.ArgumentParser.parse_args |
( |
|
self, |
|
|
|
args |
|
) |
| |
Parse given arguments and return options and positional arguments.
Arguments must be given as a list and are typically sys.argv[1:].
Options are returned as a dictionary where long options are keys. Value
is a string for those options that can be given only one time (if they
are given multiple times the last value is used) or None if the option
is not used at all. Value for options that can be given multiple times
(denoted with '*' in the usage) is a list which contains all the given
values and is empty if options are not used. Options not taken
arguments have value False when they are not set and True otherwise.
Positional arguments are returned as a list in the order they are given.
If 'check_args' is True, this method will automatically check that
correct number of arguments, as parsed from the usage line, are given.
If the last argument in the usage line ends with the character 's',
the maximum number of arguments is infinite.
Possible errors in processing arguments are reported using DataError.
Some options have a special meaning and are handled automatically
if defined in the usage and given from the command line:
--argumentfile can be used to automatically read arguments from
a specified file. When --argumentfile is used, the parser always
allows using it multiple times. Adding '*' to denote that is thus
recommend. A special value 'stdin' can be used to read arguments from
stdin instead of a file.
--pythonpath can be used to add extra path(s) to sys.path.
This functionality was deprecated in Robot Framework 5.0.
--help and --version automatically generate help and version messages.
Version is generated based on the tool name and version -- see __init__
for information how to set them. Help contains the whole usage given to
__init__. Possible <VERSION> text in the usage is replaced with the
given version. Both help and version are wrapped to Information
exception.
Definition at line 134 of file argumentparser.py.
◆ _arg_limit_validator
| robot.utils.argumentparser.ArgumentParser._arg_limit_validator |
|
private |
◆ _auto_argumentfile
| robot.utils.argumentparser.ArgumentParser._auto_argumentfile |
|
private |
◆ _auto_help
| robot.utils.argumentparser.ArgumentParser._auto_help |
|
private |
◆ _auto_pythonpath
| robot.utils.argumentparser.ArgumentParser._auto_pythonpath |
|
private |
◆ _auto_version
| robot.utils.argumentparser.ArgumentParser._auto_version |
|
private |
◆ _env_options
| robot.utils.argumentparser.ArgumentParser._env_options |
|
private |
◆ _expected_args
| robot.utils.argumentparser.ArgumentParser._expected_args |
|
private |
◆ _flag_opts
| robot.utils.argumentparser.ArgumentParser._flag_opts |
|
private |
◆ _long_opts
| robot.utils.argumentparser.ArgumentParser._long_opts |
|
private |
◆ _multi_opts
| robot.utils.argumentparser.ArgumentParser._multi_opts |
|
private |
◆ _opt_line_re
| robot.utils.argumentparser.ArgumentParser._opt_line_re |
|
staticprivate |
◆ _short_opts
| robot.utils.argumentparser.ArgumentParser._short_opts |
|
private |
◆ _short_to_long
| robot.utils.argumentparser.ArgumentParser._short_to_long |
|
private |
◆ _usage
| robot.utils.argumentparser.ArgumentParser._usage |
|
private |
◆ _validator
| robot.utils.argumentparser.ArgumentParser._validator |
|
private |
◆ name
| robot.utils.argumentparser.ArgumentParser.name |
◆ version
| robot.utils.argumentparser.ArgumentParser.version |
The documentation for this class was generated from the following file: