diff options
author | Aaron N. Brock <AaronNBrock@gmail.com> | 2019-11-22 10:40:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-22 10:40:37 -0500 |
commit | 420e9d789a26223df9dd7df7625daf032a3f5083 (patch) | |
tree | 0ccfcd55671fd4d68b61a91188c984563384ee30 /plugins/urltools/urltools.plugin.zsh | |
parent | 5722677884e85ae910daab4b4624745af74540e6 (diff) | |
parent | 76d6b0256398ad1becbc304a78f51bbacfee50e5 (diff) | |
download | zsh-420e9d789a26223df9dd7df7625daf032a3f5083.tar.gz zsh-420e9d789a26223df9dd7df7625daf032a3f5083.tar.bz2 zsh-420e9d789a26223df9dd7df7625daf032a3f5083.zip |
Merge branch 'master' into colorize-chroma-support
Diffstat (limited to 'plugins/urltools/urltools.plugin.zsh')
-rw-r--r-- | plugins/urltools/urltools.plugin.zsh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/urltools/urltools.plugin.zsh b/plugins/urltools/urltools.plugin.zsh index 47d9a34e4..b443e5027 100644 --- a/plugins/urltools/urltools.plugin.zsh +++ b/plugins/urltools/urltools.plugin.zsh @@ -12,11 +12,11 @@ if [[ $(whence node) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD alias urlencode='node -e "console.log(encodeURIComponent(process.argv[1]))"' alias urldecode='node -e "console.log(decodeURIComponent(process.argv[1]))"' elif [[ $(whence python3) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xpython" ) ]]; then - alias urlencode='python3 -c "import sys, urllib.parse as up; print(up.quote_plus(sys.argv[1]))"' - alias urldecode='python3 -c "import sys, urllib.parse as up; print(up.unquote_plus(sys.argv[1]))"' + alias urlencode='python3 -c "import sys; del sys.path[0]; import urllib.parse as up; print(up.quote_plus(sys.argv[1]))"' + alias urldecode='python3 -c "import sys; del sys.path[0]; import urllib.parse as up; print(up.unquote_plus(sys.argv[1]))"' elif [[ $(whence python2) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xpython" ) ]]; then - alias urlencode='python2 -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"' - alias urldecode='python2 -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"' + alias urlencode='python2 -c "import sys; del sys.path[0]; import urllib as ul; print ul.quote_plus(sys.argv[1])"' + alias urldecode='python2 -c "import sys; del sys.path[0]; import urllib as ul; print ul.unquote_plus(sys.argv[1])"' elif [[ $(whence xxd) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xshell" ) ]]; then function urlencode() {echo $@ | tr -d "\n" | xxd -plain | sed "s/\(..\)/%\1/g"} function urldecode() {printf $(echo -n $@ | sed 's/\\/\\\\/g;s/\(%\)\([0-9a-fA-F][0-9a-fA-F]\)/\\x\2/g')"\n"} |