cmd/repeat.py

17 lines
256 B
Python
Raw Normal View History

2019-06-12 05:41:31 +00:00
'''
Repeat the input as many times as you want
> repeat "hello" 8
> echo hi | repeat !i 4
'''
import sys
from voussoirkit import clipext
text = clipext.resolve(sys.argv[1])
repeat_times = int(sys.argv[2])
for t in range(repeat_times):
print(text)