helm/bin/urlencode
2017-04-04 01:48:55 -04:00

8 lines
193 B
Python
Executable file

#!/usr/bin/env python
import os, sys, urllib
if os.isatty(file.fileno(sys.stdin)):
text = sys.argv[1]
else:
text = "".join(sys.stdin.readlines())
print(urllib.quote_plus(text.strip()))