aws-auth: Added bash-completion
This commit is contained in:
parent
9910654818
commit
29a8f98c75
2 changed files with 11 additions and 0 deletions
10
.bash_completion.d/completions/aws-auth
Executable file
10
.bash_completion.d/completions/aws-auth
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
function _aws-auth {
|
||||||
|
if [ "${#COMP_WORDS[@]}" != "2" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
local aws_profiles
|
||||||
|
aws_profiles="$(pcre2grep -O '$1' '(?>\[\s*profile )(\S+)(?>\s*\])' ~/.aws/config)"
|
||||||
|
COMPREPLY=($(compgen -W "$aws_profiles" "${COMP_WORDS[$COMP_CWORD]}" ))
|
||||||
|
}
|
||||||
|
|
||||||
|
complete -F _aws-auth aws-auth
|
1
.environment.d/bash_completion.env
Normal file
1
.environment.d/bash_completion.env
Normal file
|
@ -0,0 +1 @@
|
||||||
|
BASH_COMPLETION_USER_DIR="${HOME}/.bash_completion.d"
|
Loading…
Add table
Add a link
Reference in a new issue