Files
git-sync/rootfs/etc/bash_completion.d/openlo-completion.bash

10 lines
354 B
Bash

_devices_loopback() {
local curw
COMPREPLY=()
curw=${COMP_WORDS[COMP_CWORD]}
prev="${COMP_WORDS[COMP_CWORD-1]}"
COMPREPLY=($(compgen -W "$(cat ~/.bashrc | grep -A 50 "openlo(" | grep ')' | grep -v '{' | awk '{print $1}' | tr -d ')')" -- $curw))
return 0
}
complete -F _devices_loopback -o dirnames openlo