Use pipeable.stdout instead of print.

This commit is contained in:
voussoir 2023-09-13 19:29:55 -07:00
parent a40dff9f49
commit db2fab6628
2 changed files with 4 additions and 3 deletions

View file

@ -5,13 +5,14 @@ import argparse
import pyperclip import pyperclip
import sys import sys
from voussoirkit import pipeable
def clipboard_argparse(args): def clipboard_argparse(args):
if args.output_file: if args.output_file:
open(args.output_file, 'w', encoding='utf-8').write(pyperclip.paste()) open(args.output_file, 'w', encoding='utf-8').write(pyperclip.paste())
else: else:
text = pyperclip.paste() text = pyperclip.paste()
text = text.replace('\r', '') pipeable.stdout(text)
print(text)
return 0 return 0

View file

@ -1,4 +1,4 @@
from voussoirkit import pipeable from voussoirkit import pipeable
for line in pipeable.go(): for line in pipeable.go():
print(repr(line)) pipeable.stdout(repr(line))