helm/bin/urlencode.sh
2017-01-03 03:44:35 -05:00

8 lines
193 B
Bash
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()))