summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2019-03-23 20:56:55 +0100
committerMarc Cornellà <marc.cornella@live.com>2019-03-24 19:50:47 +0100
commit5f893dcd209fdad920a1450355acbd4c10faabf2 (patch)
treedcf3cd9f990726a23c8f424652711758c9ffa471
parent4f4985fddc632a1d9745aec94ce95bea10006f97 (diff)
downloadzsh-5f893dcd209fdad920a1450355acbd4c10faabf2.tar.gz
zsh-5f893dcd209fdad920a1450355acbd4c10faabf2.tar.bz2
zsh-5f893dcd209fdad920a1450355acbd4c10faabf2.zip
aws: clean up aws_change_access_key function
-rw-r--r--plugins/aws/aws.plugin.zsh21
1 files changed, 11 insertions, 10 deletions
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index 7005af2d6..6de329bb8 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -15,18 +15,19 @@ function asp {
}
function aws_change_access_key {
- if [[ "x$1" == "x" ]] then
- echo "usage: $0 <profile.name>"
+ if [[ -z "$1" ]] then
+ echo "usage: $0 <profile>"
return 1
- else
- echo "Insert the credentials when asked."
- asp $1
- aws iam create-access-key
- aws configure --profile $1
- echo "You can now safely delete the old access key running 'aws iam delete-access-key --access-key-id ID'"
- echo "Your current keys are:"
- aws iam list-access-keys
fi
+
+ echo Insert the credentials when asked.
+ asp "$1"
+ aws iam create-access-key
+ aws configure --profile "$1"
+
+ echo You can now safely delete the old access key running \`aws iam delete-access-key --access-key-id ID\`
+ echo Your current keys are:
+ aws iam list-access-keys
}
function aws_profiles {