From c7791bb526be6bd95e0c5b4f710853fb84085a8a Mon Sep 17 00:00:00 2001 From: Jeremy Mayeres Date: Fri, 20 Jul 2018 19:20:04 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9A=20Improve=20docs=20about=20ScriptI?= =?UTF-8?q?nfo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improve documentation for the CLI using application factories and how/when the ScriptInfo object is passed with Application Discovery --- docs/cli.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/cli.rst b/docs/cli.rst index 7ce63fd2..d8bb39c1 100644 --- a/docs/cli.rst +++ b/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