# bash completion for nodesync -*- shell-script -*- _nodesync () { local cur prev words cword _init_completion || return echo "$cur $prev $words $cword" >> /tmp/xxx case $prev in nodesync) COMPREPLY=( $( compgen -W 'transaction file set sync' -- "$cur" ) ) return 0 ;; transaction) COMPREPLY=( $( compgen -W 'start commit rollback' -- "$cur" ) ) return 0 ;; file) COMPREPLY=( $( compgen -W 'add rm script' -- "$cur" ) ) return 0 ;; add|rm|syncroot) _filedir return 0 ;; script) return 0 ;; set) COMPREPLY=( $( compgen -W 'syncroot partition' -- "$cur" ) ) return 0 ;; esac if [ $cword -gt 2 ]; then COMPREPLY=() fi } && complete -F _nodesync nodesync