forked from orbit-oss/flask
📚 Improve docs about ScriptInfo
Improve documentation for the CLI using application factories and how/when the ScriptInfo object is passed with Application Discovery
This commit is contained in:
parent
06b189b6be
commit
c7791bb526
1 changed files with 6 additions and 4 deletions
10
docs/cli.rst
10
docs/cli.rst
|
|
@ -78,10 +78,12 @@ found, the command looks for a factory function named ``create_app`` or
|
|||
``make_app`` that returns an instance.
|
||||
|
||||
When calling an application factory, if the factory takes an argument named
|
||||
``info``, then the :class:`~cli.ScriptInfo` instance is passed as a keyword
|
||||
argument. If parentheses follow the factory name, their contents are parsed
|
||||
as Python literals and passes as arguments to the function. This means that
|
||||
strings must still be in quotes.
|
||||
``script_info``, then the :class:`~cli.ScriptInfo` instance is passed as a
|
||||
keyword argument. If the application factory takes only one argument and no
|
||||
parentheses follow the factory name, the :class:`~cli.ScriptInfo` instance
|
||||
is passed as a positional argument. If parentheses follow the factory name,
|
||||
their contents are parsed as Python literals and passes as arguments to the
|
||||
function. This means that strings must still be in quotes.
|
||||
|
||||
|
||||
Run the Development Server
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue