diff options
author | kotfu <kotfu@kotfu.net> | 2019-07-15 22:04:01 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2019-07-15 22:04:01 -0600 |
commit | 901acfefffbc1efce28d0ea7adcc059098e97cd0 (patch) | |
tree | d155801a2acb827aab2d277d3c4cfd92c5b234f6 /docs/features | |
parent | 1b7330a58f37c481b17c8da9e7203dd3fe4c0461 (diff) | |
download | cmd2-git-901acfefffbc1efce28d0ea7adcc059098e97cd0.tar.gz |
Write clipboard feature page
It used to have a weak-sauce paste from the old documentation. Now it’s a real page. Addresses feedback in the PR.
Diffstat (limited to 'docs/features')
-rw-r--r-- | docs/features/clipboard.rst | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/docs/features/clipboard.rst b/docs/features/clipboard.rst index 6df655f7..73e206c2 100644 --- a/docs/features/clipboard.rst +++ b/docs/features/clipboard.rst @@ -1,10 +1,33 @@ Clipboard Integration ===================== - - sent to the operating system paste buffer, by ending with a bare ``>``, as - in ``mycommand args >``. You can even append output to the current contents - of the paste buffer by ending your command with ``>>``. +Nearly every operating system has some notion of a short-term storage area +which can be accessed by any program. Usually this is called the clipboard, but +sometimes people refer to it as the paste buffer. +``cmd2`` integrates with the operating system clipboard using the `pyperclip +<https://github.com/asweigart/pyperclip>`_ module. Command output can be sent +to the clipboard by ending the command with a greater than symbol: + +.. code-block:: text + + mycommand args > + +Think of it as though you are redirecting output to an unnamed, ephemeral +place, you know, like the clipboard. You can also append output to the current +contents of the clipboard by ending the command with two greater than symbols: + +.. code-block:: text + + mycommand arg1 arg2 >> + + +Developers +---------- + +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). .. automodule:: cmd2.clipboard :members: |