diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index d31052f83..43502cc9e 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -15,17 +15,26 @@ function agp { function asp { local rprompt=${RPROMPT//} - export AWS_DEFAULT_PROFILE=$1 - export AWS_PROFILE=$1 + switch_profile $1 export RPROMPT="$rprompt" } +function acp { + switch_profile $1 +} + +function switch_profile { + export AWS_DEFAULT=$1 + export AWS_PROFILE=$1 +} + function aws_profiles { reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/')) } compctl -K aws_profiles asp +compctl -K aws_profiles acp if _homebrew-installed && _awscli-homebrew-installed ; then _aws_zsh_completer_path=$(brew --prefix awscli)/libexec/bin/aws_zsh_completer.sh