|
| def | __init__ (self, usage, name=None, version=None, arg_limits=None, validator=None, env_options=None, auto_help=True, auto_version=True, auto_escape=True, auto_pythonpath=True, 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_available_escapes (self) |
| |
| def | _get_default_opts (self) |
| |
| def | _get_env_options (self) |
| |
| def | _get_escapes (self, escape_strings) |
| |
| 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 | _save_filenames (self, args) |
| |
| def | _split_pythonpath (self, paths) |
| |
| def | _unescape (self, value, escapes) |
| |
| def | _unescape_opts_and_args (self, opts, args) |
| |
| def | _verify_long_not_already_used (self, opt, flag=False) |
| |
Definition at line 62 of file argumentparser.py.
◆ __init__()
| def robotide.lib.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_escape = True, |
|
|
|
auto_pythonpath = True, |
|
|
|
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 84 of file argumentparser.py.
◆ _create_option()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._create_option |
( |
|
self, |
|
|
|
short_opts, |
|
|
|
long_opt, |
|
|
|
takes_arg, |
|
|
|
is_multi |
|
) |
| |
|
private |
◆ _create_options()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._create_options |
( |
|
self, |
|
|
|
usage |
|
) |
| |
|
private |
◆ _get_available_escapes()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._get_available_escapes |
( |
|
self | ) |
|
|
private |
◆ _get_default_opts()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._get_default_opts |
( |
|
self | ) |
|
|
private |
◆ _get_env_options()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._get_env_options |
( |
|
self | ) |
|
|
private |
◆ _get_escapes()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._get_escapes |
( |
|
self, |
|
|
|
escape_strings |
|
) |
| |
|
private |
◆ _get_name()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._get_name |
( |
|
self, |
|
|
|
name |
|
) |
| |
|
private |
◆ _get_pythonpath()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._get_pythonpath |
( |
|
self, |
|
|
|
paths |
|
) |
| |
|
private |
◆ _glob_args()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._glob_args |
( |
|
self, |
|
|
|
args |
|
) |
| |
|
private |
◆ _handle_special_options()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._handle_special_options |
( |
|
self, |
|
|
|
opts, |
|
|
|
args |
|
) |
| |
|
private |
◆ _lowercase_long_option()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._lowercase_long_option |
( |
|
self, |
|
|
|
opt |
|
) |
| |
|
private |
◆ _parse_args()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._parse_args |
( |
|
self, |
|
|
|
args |
|
) |
| |
|
private |
◆ _process_opts()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._process_opts |
( |
|
self, |
|
|
|
opt_tuple |
|
) |
| |
|
private |
◆ _process_possible_argfile()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._process_possible_argfile |
( |
|
self, |
|
|
|
args |
|
) |
| |
|
private |
◆ _raise_help()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._raise_help |
( |
|
self | ) |
|
|
private |
◆ _raise_option_multiple_times_in_usage()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._raise_option_multiple_times_in_usage |
( |
|
self, |
|
|
|
opt |
|
) |
| |
|
private |
◆ _raise_version()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._raise_version |
( |
|
self | ) |
|
|
private |
◆ _save_filenames()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._save_filenames |
( |
|
self, |
|
|
|
args |
|
) |
| |
|
private |
◆ _split_pythonpath()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._split_pythonpath |
( |
|
self, |
|
|
|
paths |
|
) |
| |
|
private |
◆ _unescape()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._unescape |
( |
|
self, |
|
|
|
value, |
|
|
|
escapes |
|
) |
| |
|
private |
◆ _unescape_opts_and_args()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._unescape_opts_and_args |
( |
|
self, |
|
|
|
opts, |
|
|
|
args |
|
) |
| |
|
private |
◆ _verify_long_not_already_used()
| def robotide.lib.robot.utils.argumentparser.ArgumentParser._verify_long_not_already_used |
( |
|
self, |
|
|
|
opt, |
|
|
|
flag = False |
|
) |
| |
|
private |
◆ parse_args()
| def robotide.lib.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:
--escape option can be used to automatically unescape problematic
characters given in an escaped format.
--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.
--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. Possible <--ESCAPES--> is replaced with available
escapes so that they are wrapped to multiple lines but take the same
amount of horizontal space as <---ESCAPES--->. Both help and version
are wrapped to Information exception.
Definition at line 153 of file argumentparser.py.
◆ _arg_limit_validator
| robotide.lib.robot.utils.argumentparser.ArgumentParser._arg_limit_validator |
|
private |
◆ _auto_argumentfile
| robotide.lib.robot.utils.argumentparser.ArgumentParser._auto_argumentfile |
|
private |
◆ _auto_escape
| robotide.lib.robot.utils.argumentparser.ArgumentParser._auto_escape |
|
private |
◆ _auto_help
| robotide.lib.robot.utils.argumentparser.ArgumentParser._auto_help |
|
private |
◆ _auto_pythonpath
| robotide.lib.robot.utils.argumentparser.ArgumentParser._auto_pythonpath |
|
private |
◆ _auto_version
| robotide.lib.robot.utils.argumentparser.ArgumentParser._auto_version |
|
private |
◆ _env_options
| robotide.lib.robot.utils.argumentparser.ArgumentParser._env_options |
|
private |
◆ _expected_args
| robotide.lib.robot.utils.argumentparser.ArgumentParser._expected_args |
|
private |
◆ _flag_opts
| robotide.lib.robot.utils.argumentparser.ArgumentParser._flag_opts |
|
private |
◆ _long_opts
| robotide.lib.robot.utils.argumentparser.ArgumentParser._long_opts |
|
private |
◆ _multi_opts
| robotide.lib.robot.utils.argumentparser.ArgumentParser._multi_opts |
|
private |
◆ _opt_line_re
| robotide.lib.robot.utils.argumentparser.ArgumentParser._opt_line_re |
|
staticprivate |
◆ _quotes_re
| robotide.lib.robot.utils.argumentparser.ArgumentParser._quotes_re |
|
staticprivate |
◆ _short_opts
| robotide.lib.robot.utils.argumentparser.ArgumentParser._short_opts |
|
private |
◆ _short_to_long
| robotide.lib.robot.utils.argumentparser.ArgumentParser._short_to_long |
|
private |
◆ _usage
| robotide.lib.robot.utils.argumentparser.ArgumentParser._usage |
|
private |
◆ _validator
| robotide.lib.robot.utils.argumentparser.ArgumentParser._validator |
|
private |
◆ name
| robotide.lib.robot.utils.argumentparser.ArgumentParser.name |
◆ version
| robotide.lib.robot.utils.argumentparser.ArgumentParser.version |
The documentation for this class was generated from the following file: