Skip to content

Commit

Permalink
Improve aws profile autocomplete (#1)
Browse files Browse the repository at this point in the history
* Improve aws profile autocomplete

look in config also;
merge findings and return unique ones;

* Move sed line to current/correct place

---------

Co-authored-by: Roman Zhuzha <roman.zhuzha@trivago.com>
Co-authored-by: Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
  • Loading branch information
3 people authored Aug 3, 2023
1 parent df2ab7f commit e53a1de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions/aws.fish
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function aws -a cmd -d 'Universal CLI for AWS'
end

case profiles
command sed -n -e 's/^\[\(.*\)\]/\1/p' "$HOME/.aws/credentials"
command sed -n "s/^\[\(profile[[:space:]]*\)*\(.*\)\]/\2/p" "$HOME/.aws/config" "$HOME/.aws/credentials" | sort | uniq

case '*'
command aws $argv
Expand Down

0 comments on commit e53a1de

Please sign in to comment.