else/Toolbox/clipboard.py
Ethan Dalool 97403c7d5f else
2016-12-04 17:50:52 -08:00

14 lines
314 B
Python

'''
Dump the clipboard to stdout. I use this for redirecting to files.
'''
import pyperclip
import sys
if len(sys.argv) > 1:
from voussoirkit import clipext
stuff = clipext.resolve(sys.argv[1])
pyperclip.copy(stuff)
else:
text = pyperclip.paste()
text = text.replace('\r', '')
print(text)