Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
click.parser._OptionParser Class Reference

Public Member Functions

None __init__ (self, Context|None ctx=None)
 
None add_option (self, CoreOption obj, cabc.Sequence[str] opts, str|None dest, str|None action=None, int nargs=1, t.Any|None const=None)
 
None add_argument (self, CoreArgument obj, str|None dest, int nargs=1)
 
tuple[dict[str, t.Any], list[str], list[CoreParameter]] parse_args (self, list[str] args)
 

Public Attributes

 ctx
 
 allow_interspersed_args
 
 ignore_unknown_options
 

Protected Member Functions

None _process_args_for_args (self, _ParsingState state)
 
None _process_args_for_options (self, _ParsingState state)
 
None _match_long_opt (self, str opt, str|None explicit_value, _ParsingState state)
 
None _match_short_opt (self, str arg, _ParsingState state)
 
str|cabc.Sequence[str]|T_FLAG_NEEDS_VALUE _get_value_from_state (self, str option_name, _Option option, _ParsingState state)
 
None _process_opts (self, str arg, _ParsingState state)
 

Protected Attributes

 _opt_prefixes
 
 _args
 

Detailed Description

The option parser is an internal class that is ultimately used to
parse options and arguments.  It's modelled after optparse and brings
a similar but vastly simplified API.  It should generally not be used
directly as the high level Click classes wrap it for you.

It's not nearly as extensible as optparse or argparse as it does not
implement features that are implemented on a higher level (such as
types or defaults).

:param ctx: optionally the :class:`~click.Context` where this parser
            should go with.

.. deprecated:: 8.2
    Will be removed in Click 9.0.

Member Function Documentation

◆ add_argument()

None click.parser._OptionParser.add_argument (   self,
CoreArgument  obj,
str | None  dest,
int   nargs = 1 
)
Adds a positional argument named `dest` to the parser.

The `obj` can be used to identify the option in the order list
that is returned from the parser.

◆ add_option()

None click.parser._OptionParser.add_option (   self,
CoreOption  obj,
cabc.Sequence[str]  opts,
str | None  dest,
str | None   action = None,
int   nargs = 1,
t.Any | None   const = None 
)
Adds a new option named `dest` to the parser.  The destination
is not inferred (unlike with optparse) and needs to be explicitly
provided.  Action can be any of ``store``, ``store_const``,
``append``, ``append_const`` or ``count``.

The `obj` can be used to identify the option in the order list
that is returned from the parser.

◆ parse_args()

tuple[dict[str, t.Any], list[str], list[CoreParameter]] click.parser._OptionParser.parse_args (   self,
list[str]   args 
)
Parses positional arguments and returns ``(values, args, order)``
for the parsed options and arguments as well as the leftover
arguments if there are any.  The order is a list of objects as they
appear on the command line.  If arguments appear multiple times they
will be memorized multiple times as well.

The documentation for this class was generated from the following file: