summaryrefslogtreecommitdiff
path: root/plugins/aws/aws.plugin.zsh
diff options
context:
space:
mode:
authorCristian Măgherușan-Stanciu <cristi.magherusan@gmail.com>2013-10-09 16:42:28 +0200
committerCristian Măgherușan-Stanciu <cristi.magherusan@gmail.com>2013-10-09 17:00:39 +0200
commit190fcdffa7bc413dc7a9ebef4a6eaed37beb6896 (patch)
treebac02618ede29b4bfeaa9fb5abac87063dc63f03 /plugins/aws/aws.plugin.zsh
parent61e3951e4be2f496d8ce8022afc58817c06e5dee (diff)
downloadzsh-190fcdffa7bc413dc7a9ebef4a6eaed37beb6896.tar.gz
zsh-190fcdffa7bc413dc7a9ebef4a6eaed37beb6896.tar.bz2
zsh-190fcdffa7bc413dc7a9ebef4a6eaed37beb6896.zip
Added a completion plugin for the new aws-cli tool
It also supports quickly switching AWS profiles defined in ~/.aws/config using the asp alias
Diffstat (limited to 'plugins/aws/aws.plugin.zsh')
-rw-r--r--plugins/aws/aws.plugin.zsh17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
new file mode 100644
index 000000000..3f7fb1995
--- /dev/null
+++ b/plugins/aws/aws.plugin.zsh
@@ -0,0 +1,17 @@
+export AWS_HOME=~/.aws
+
+function agp {
+ echo $AWS_DEFAULT_PROFILE
+
+}
+function asp {
+ export AWS_DEFAULT_PROFILE=$1
+ export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>"
+
+}
+function aws_profiles {
+ reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
+}
+
+compctl -K aws_profiles asp
+source `which aws_zsh_completer.sh`