Pracownia_programowania/venv/Lib/site-packages/pyperclip/__main__.py
2020-02-01 20:05:44 +01:00

12 lines
447 B
Python

import pyperclip
import sys
if len(sys.argv) > 1 and sys.argv[1] in ('-c', '--copy'):
pyperclip.copy(sys.stdin.read())
elif len(sys.argv) > 1 and sys.argv[1] in ('-p', '--paste'):
sys.stdout.write(pyperclip.paste())
else:
print('Usage: python -m pyperclip [-c | --copy] | [-p | --paste]')
print()
print('When copying, stdin will be placed on the clipboard.')
print('When pasting, the clipboard will be written to stdout.')