|
OpenQuizz
Une application de gestion des contenus pédagogiques
|


Public Member Functions | |
| def | __init__ (self, name, context_settings=None, callback=None, params=None, help=None, epilog=None, short_help=None, options_metavar="[OPTIONS]", add_help_option=True, no_args_is_help=False, hidden=False, deprecated=False) |
| def | get_usage (self, ctx) |
| def | get_params (self, ctx) |
| def | format_usage (self, ctx, formatter) |
| def | collect_usage_pieces (self, ctx) |
| def | get_help_option_names (self, ctx) |
| def | get_help_option (self, ctx) |
| def | make_parser (self, ctx) |
| def | get_help (self, ctx) |
| def | get_short_help_str (self, limit=45) |
| def | format_help (self, ctx, formatter) |
| def | format_help_text (self, ctx, formatter) |
| def | format_options (self, ctx, formatter) |
| def | format_epilog (self, ctx, formatter) |
| def | parse_args (self, ctx, args) |
| def | invoke (self, ctx) |
Public Member Functions inherited from BaseCommand | |
| def | __init__ (self, name, context_settings=None) |
| def | __repr__ (self) |
| def | make_context (self, info_name, args, parent=None, **extra) |
| def | main (self, args=None, prog_name=None, complete_var=None, standalone_mode=True, **extra) |
| def | __call__ (self, *args, **kwargs) |
Data Fields | |
| callback | |
| params | |
| help | |
| epilog | |
| options_metavar | |
| short_help | |
| add_help_option | |
| no_args_is_help | |
| hidden | |
| deprecated | |
Data Fields inherited from BaseCommand | |
| name | |
| context_settings | |
Additional Inherited Members | |
Static Public Attributes inherited from BaseCommand | |
| bool | allow_extra_args = False |
| bool | allow_interspersed_args = True |
| bool | ignore_unknown_options = False |
Commands are the basic building block of command line interfaces in
Click. A basic command handles command line parsing and might dispatch
more parsing to commands nested below it.
.. versionchanged:: 2.0
Added the `context_settings` parameter.
.. versionchanged:: 7.1
Added the `no_args_is_help` parameter.
:param name: the name of the command to use unless a group overrides it.
:param context_settings: an optional dictionary with defaults that are
passed to the context object.
:param callback: the callback to invoke. This is optional.
:param params: the parameters to register with this command. This can
be either :class:`Option` or :class:`Argument` objects.
:param help: the help string to use for this command.
:param epilog: like the help string but it's printed at the end of the
help page after everything else.
:param short_help: the short help to use for this command. This is
shown on the command listing of the parent command.
:param add_help_option: by default each command registers a ``--help``
option. This can be disabled by this parameter.
:param no_args_is_help: this controls what happens if no arguments are
provided. This option is disabled by default.
If enabled this will add ``--help`` as argument
if no arguments are passed
:param hidden: hide this command from help outputs.
:param deprecated: issues a message indicating that
the command is deprecated.
| def __init__ | ( | self, | |
| name, | |||
context_settings = None, |
|||
callback = None, |
|||
params = None, |
|||
help = None, |
|||
epilog = None, |
|||
short_help = None, |
|||
options_metavar = "[OPTIONS]", |
|||
add_help_option = True, |
|||
no_args_is_help = False, |
|||
hidden = False, |
|||
deprecated = False |
|||
| ) |
| def collect_usage_pieces | ( | self, | |
| ctx | |||
| ) |
Returns all the pieces that go into the usage line and returns it as a list of strings.
Reimplemented in MultiCommand.
| def format_epilog | ( | self, | |
| ctx, | |||
| formatter | |||
| ) |
Writes the epilog into the formatter if it exists.
| def format_help | ( | self, | |
| ctx, | |||
| formatter | |||
| ) |
Writes the help into the formatter if it exists. This is a low-level method called by :meth:`get_help`. This calls the following methods: - :meth:`format_usage` - :meth:`format_help_text` - :meth:`format_options` - :meth:`format_epilog`
| def format_help_text | ( | self, | |
| ctx, | |||
| formatter | |||
| ) |
Writes the help text to the formatter if it exists.
| def format_options | ( | self, | |
| ctx, | |||
| formatter | |||
| ) |
Writes all the options into the formatter if they exist.
Reimplemented in MultiCommand.
| def format_usage | ( | self, | |
| ctx, | |||
| formatter | |||
| ) |
Writes the usage line into the formatter. This is a low-level method called by :meth:`get_usage`.
| def get_help | ( | self, | |
| ctx | |||
| ) |
Formats the help into a string and returns it. Calls :meth:`format_help` internally.
Reimplemented from BaseCommand.
| def get_help_option | ( | self, | |
| ctx | |||
| ) |
Returns the help option object.
| def get_help_option_names | ( | self, | |
| ctx | |||
| ) |
Returns the names for the help option.
| def get_params | ( | self, | |
| ctx | |||
| ) |
| def get_short_help_str | ( | self, | |
limit = 45 |
|||
| ) |
Gets short help for the command or makes it by shortening the long help string.
| def get_usage | ( | self, | |
| ctx | |||
| ) |
Formats the usage line into a string and returns it. Calls :meth:`format_usage` internally.
Reimplemented from BaseCommand.
| def invoke | ( | self, | |
| ctx | |||
| ) |
Given a context, this invokes the attached callback (if it exists) in the right way.
Reimplemented from BaseCommand.
Reimplemented in MultiCommand.
| def make_parser | ( | self, | |
| ctx | |||
| ) |
Creates the underlying option parser for this command.
| def parse_args | ( | self, | |
| ctx, | |||
| args | |||
| ) |
Given a context and a list of arguments this creates the parser and parses the arguments, then modifies the context as necessary. This is automatically invoked by :meth:`make_context`.
Reimplemented from BaseCommand.
Reimplemented in MultiCommand.
| add_help_option |
| callback |
| deprecated |
| epilog |
| help |
| hidden |
| no_args_is_help |
| options_metavar |
| params |
| short_help |