5f893dcd209fdad920a1450355acbd4c10faabf2

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

aws: clean up aws_change_access_key function

Diff

 1diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
 2index 7005af2d65932f258ab2f026d1eb6b2530a4f40b..6de329bb851e741d87d1fe6fca0c068b8c71c81c 100644
 3--- a/plugins/aws/aws.plugin.zsh
 4+++ b/plugins/aws/aws.plugin.zsh
 5@@ -15,18 +15,19 @@ function asp {
 6 }
 7 
 8 function aws_change_access_key {
 9-  if [[ "x$1" == "x" ]] then
10-    echo "usage: $0 <profile.name>"
11+  if [[ -z "$1" ]] then
12+    echo "usage: $0 <profile>"
13     return 1
14-  else
15-    echo "Insert the credentials when asked."
16-    asp $1
17-    aws iam create-access-key
18-    aws configure --profile $1
19-    echo "You can now safely delete the old access key running 'aws iam delete-access-key --access-key-id ID'"
20-    echo "Your current keys are:"
21-    aws iam list-access-keys
22   fi
23+
24+  echo Insert the credentials when asked.
25+  asp "$1"
26+  aws iam create-access-key
27+  aws configure --profile "$1"
28+
29+  echo You can now safely delete the old access key running \`aws iam delete-access-key --access-key-id ID\`
30+  echo Your current keys are:
31+  aws iam list-access-keys
32 }
33 
34 function aws_profiles {