190fcdffa7bc413dc7a9ebef4a6eaed37beb6896

Author
Cristian Măgherușan-Stanciu <cristi.magherusan@gmail.com>
Committer
Cristian Măgherușan-Stanciu <cristi.magherusan@gmail.com>
Date

Message

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

Diff

 1diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..3f7fb199581c399916ceae46ff60ef3c3edd7485
 4--- /dev/null
 5+++ b/plugins/aws/aws.plugin.zsh
 6@@ -0,0 +1,17 @@
 7+export AWS_HOME=~/.aws
 8+
 9+function agp {
10+  echo $AWS_DEFAULT_PROFILE
11+  
12+}
13+function asp {
14+  export AWS_DEFAULT_PROFILE=$1
15+    export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>"
16+    
17+}
18+function aws_profiles {
19+  reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
20+}
21+
22+compctl -K aws_profiles asp
23+source `which aws_zsh_completer.sh`