From 190fcdffa7bc413dc7a9ebef4a6eaed37beb6896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20M=C4=83gheru=C8=99an-Stanciu?= Date: Wed, 9 Oct 2013 16:42:28 +0200 Subject: [PATCH] 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 --- plugins/aws/aws.plugin.zsh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 plugins/aws/aws.plugin.zsh diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh new file mode 100644 index 00000000..3f7fb199 --- /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="" + +} +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`