add new func for pdsh completion

This commit is contained in:
Jakobus Schürz 2020-01-15 13:53:20 +01:00
parent b2c93eee6b
commit 931bf7e44e

11
bash_completion.d/pdsh Normal file
View file

@ -0,0 +1,11 @@
#!/bin/bash
function _pdshgroups() {
COMPREPLY=()
local CUR KEYS
CUR="${COMP_WORDS[COMP_CWORD]}"
KEYS="$(find ~/.dsh/group/* -type f -exec basename {} \;)"
COMPREPLY=( $(compgen -W "${KEYS}" -- ${CUR}) )
return 0
}
complete -F _pdshgroups pdsh