groot/files/bash_completion

11 lines
291 B
Bash
Raw Normal View History

2024-11-08 16:14:46 +01:00
function _connect() {
COMPREPLY=()
local currentWord=${COMP_WORDS[COMP_CWORD]}
2024-11-08 16:19:50 +01:00
local completeHosts=$(cat /etc/passwd|grep "/var/www"|cut -d ':' -f 1)
2024-11-08 16:14:46 +01:00
COMPREPLY=($(compgen -W "$completeHosts" -- "$currentWord"))
return 0
}
complete -F _connect groot