1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-07-01 09:19:25 +00:00

[aws] Add function to activate and switch profiles taken from aws credentials file

This commit is contained in:
2020-02-22 16:11:38 +01:00
parent 3d827cdb88
commit fc8f82329b
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#compdef aws_switch_profile
#autoload
if [[ ! -f ~/.aws/credentials ]]; then
return 1
fi
local profiles
profiles=$(grep -E "^\[.+\]" ~/.aws/credentials | tr -d '[' | tr -d ']' )
_arguments "1:toggle:((
$profiles
))" && return 0