From a96c0f53b2a62a94582624c76c7d990012891204 Mon Sep 17 00:00:00 2001 From: Kyle King Date: Wed, 27 Jan 2021 19:16:43 -0500 Subject: Update conditional pyreadline3 dependency for Win --- docs/overview/integrating.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/overview/integrating.rst b/docs/overview/integrating.rst index db5cb206..041083bc 100644 --- a/docs/overview/integrating.rst +++ b/docs/overview/integrating.rst @@ -26,10 +26,13 @@ Windows Considerations If you would like to use :ref:`features/completion:Completion`, and you want your application to run on Windows, you will need to ensure you install the -``pyreadline`` package. Make sure to include the following in your -``setup.py``:: +``pyreadline3`` or ``pyreadline`` package. Make sure to include the following +in your ``setup.py``:: install_requires=[ 'cmd2>=1,<2', - ":sys_platform=='win32'": ['pyreadline'], + ":sys_platform=='win32'": [ + "pyreadline ; python_version<'3.8'", + "pyreadline3 ; python_version>='3.8'", # pyreadline3 is a drop-in replacement for Python 3.8 and above + ], ] -- cgit v1.2.1 From a09ad27429e9bad2983db7f3ba4e7ab287459cab Mon Sep 17 00:00:00 2001 From: "Kevin \"Tristate Tom\" Weiss" Date: Thu, 28 Jan 2021 13:51:44 +0100 Subject: Fix doc in docs/features/commands.rst finis should be finish. A missing double quote (") for the docstring in the `do_bail` example makes formatting incorrect. --- docs/features/commands.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/features/commands.rst b/docs/features/commands.rst index 8e61a472..cc603f70 100644 --- a/docs/features/commands.rst +++ b/docs/features/commands.rst @@ -127,7 +127,7 @@ without errors), and that ``cmd2`` should prompt the user for more input. If you return ``True`` from a command method, that indicates to ``cmd2`` that it should stop prompting for user input and cleanly exit. ``cmd2`` already includes a ``quit`` command, but if you wanted to make another one called -``finis`` you could:: +``finish`` you could:: def do_finish(self, line): """Exit the application""" @@ -156,7 +156,7 @@ system shell:: """A simple cmd2 application.""" def do_bail(self, line): - """Exit the application"" + """Exit the application""" self.perror("fatal error, exiting") self.exit_code = 2 return true -- cgit v1.2.1 From 6210d23662b2cf45f837f01697beb61eef42eabf Mon Sep 17 00:00:00 2001 From: "Kevin \"Tristate Tom\" Weiss" Date: Thu, 28 Jan 2021 22:06:54 +0100 Subject: docs/features/modular_commands: fix broken link I guess the examples structure has changed since the docs. I suggest changing the broken link: https://github.com/python-cmd2/cmd2/tree/master/plugins/command_sets/examples to https://github.com/python-cmd2/cmd2/tree/master/examples/modular_commands Maybe also hiding the full link is nice. --- docs/features/modular_commands.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/features/modular_commands.rst b/docs/features/modular_commands.rst index 790b933e..8bd9ba2f 100644 --- a/docs/features/modular_commands.rst +++ b/docs/features/modular_commands.rst @@ -29,7 +29,7 @@ Features See API documentation for :attr:`cmd2.command_definition.CommandSet` -See the examples for more details: https://github.com/python-cmd2/cmd2/tree/master/plugins/command_sets/examples +See [the examples](https://github.com/python-cmd2/cmd2/tree/master/examples/modular_commands) for more details. Defining Commands -- cgit v1.2.1 From 246ce9de04e16b39c123a05426b90859af2a4251 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Fri, 29 Jan 2021 11:37:09 -0500 Subject: Updated documentation --- docs/features/startup_commands.rst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs') diff --git a/docs/features/startup_commands.rst b/docs/features/startup_commands.rst index aaaf7722..f105054b 100644 --- a/docs/features/startup_commands.rst +++ b/docs/features/startup_commands.rst @@ -64,3 +64,12 @@ like so:: This text file should contain a :ref:`Command Script `. See the AliasStartup_ example for a demonstration. + +You can silence a startup script's output by setting ``silent_startup_script`` +to True:: + + cmd2.Cmd.__init__(self, startup_script='.cmd2rc', silent_startup_script=True) + +Anything written to stderr will still print. Additionally, a startup script +cannot be silenced if ``allow_redirection`` is False since silencing works +by redirecting a script's output to ``os.devnull``. -- cgit v1.2.1