summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorIan Chesal <ichesal@cyclecomputing.com>2012-10-08 15:42:27 -0400
committerIan Chesal <ichesal@cyclecomputing.com>2012-10-08 15:42:27 -0400
commita97e117281fa495bf13b7aa4179647cb9c7f5c01 (patch)
treedaa8005f50fb8077d29b20d5ce87ca2e55fd7ac2 /plugins
parent73f777053725ce61d6fada67ff3f174130dd8c94 (diff)
downloadzsh-a97e117281fa495bf13b7aa4179647cb9c7f5c01.tar.gz
zsh-a97e117281fa495bf13b7aa4179647cb9c7f5c01.tar.bz2
zsh-a97e117281fa495bf13b7aa4179647cb9c7f5c01.zip
URL Tools Plugin
* Added urlencode -- alias to encode URLs from the command line using Python * Added urldecode -- alias to decode URLs from the command line using Python
Diffstat (limited to 'plugins')
-rw-r--r--plugins/urltools/urltools.plugin.zsh9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/urltools/urltools.plugin.zsh b/plugins/urltools/urltools.plugin.zsh
new file mode 100644
index 000000000..0d29314d6
--- /dev/null
+++ b/plugins/urltools/urltools.plugin.zsh
@@ -0,0 +1,9 @@
+# URL Tools
+# Adds handy command line aliases useful for dealing with URLs
+#
+# Taken from:
+# http://ruslanspivak.com/2010/06/02/urlencode-and-urldecode-from-a-command-line/
+
+alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
+
+alias urldecode='python -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"' \ No newline at end of file