shell dot on steroids https://pagure.io/shellfu

complete.bash 561B

12345678910111213141516171819202122232425
  1. __sfpath() {
  2. local cur prev opts
  3. COMPREPLY=()
  4. cur="${COMP_WORDS[COMP_CWORD]}"
  5. prev="${COMP_WORDS[COMP_CWORD-1]}"
  6. opts="--version --version-semver"
  7. COMPREPLY=(
  8. $(compgen -W "$opts" -- ${cur})
  9. )
  10. }
  11. __sfdoc() {
  12. local cur prev opts
  13. COMPREPLY=()
  14. cur="${COMP_WORDS[COMP_CWORD]}"
  15. prev="${COMP_WORDS[COMP_CWORD-1]}"
  16. args="--help --debug --include --ls --lsmod --lsfun --lsvar --export --name"
  17. COMPREPLY=(
  18. $(compgen -W "$args" -- ${cur})
  19. )
  20. }
  21. complete -F __sfpath sfpath
  22. complete -F __sfdoc sfdoc