diff --git a/rootfs/etc/bash_completion.d/openlo-completion.bash b/rootfs/etc/bash_completion.d/openlo-completion.bash new file mode 100644 index 0000000..181b1ef --- /dev/null +++ b/rootfs/etc/bash_completion.d/openlo-completion.bash @@ -0,0 +1,10 @@ +_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 \ No newline at end of file