diff options
| author | kotfu <kotfu@kotfu.net> | 2023-01-30 17:55:16 -0700 |
|---|---|---|
| committer | kotfu <kotfu@kotfu.net> | 2023-01-30 17:55:16 -0700 |
| commit | f9ec31970e30d9bfe64ab0af170cde01ad4eab37 (patch) | |
| tree | 29d84e4140fec5c88b497805525e8839b5b70eb1 /docs | |
| parent | 8779cca4ab23a244aefe2631e3cdd31b08e164e8 (diff) | |
| download | cmd2-git-f9ec31970e30d9bfe64ab0af170cde01ad4eab37.tar.gz | |
Add documentation for allow_clipboard attribute
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/api/cmd.rst | 7 | ||||
| -rw-r--r-- | docs/features/clipboard.rst | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/docs/api/cmd.rst b/docs/api/cmd.rst index 6fdfbf27..f9bd07c6 100644 --- a/docs/api/cmd.rst +++ b/docs/api/cmd.rst @@ -65,3 +65,10 @@ cmd2.Cmd The symbol name which :ref:`features/scripting:Python Scripts` run using the :ref:`features/builtin_commands:run_pyscript` command can use to reference the parent ``cmd2`` application. + + .. attribute:: allow_clipboard + + If ``True``, ``cmd2`` will allow output to be written to or appended to + the operating system pasteboard. If ``False``, this capability will not + be allowed. See :ref:`features/clipboard:Clipboard Integration` for more + information. diff --git a/docs/features/clipboard.rst b/docs/features/clipboard.rst index 73e206c2..a4b9cdf2 100644 --- a/docs/features/clipboard.rst +++ b/docs/features/clipboard.rst @@ -25,6 +25,14 @@ contents of the clipboard by ending the command with two greater than symbols: Developers ---------- +You can control whether the above user features of adding output to the +operating system clipboard are allowed for the user by setting the +:attr:`~cmd2.Cmd.allow_clipboard` attribute. The default value is ``True``. +Set it to ``False`` and the above functionality will generate an error +message instead of adding the output to the clipboard. +:attr:`~cmd2.Cmd.allow_clipboard` can be set upon initialization, and you can +change it at any time from within your code. + If you would like your ``cmd2`` based application to be able to use the clipboard in additional or alternative ways, you can use the following methods (which work uniformly on Windows, macOS, and Linux). |
