complete.bash 444B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. __satcmd() {
  3. local cur opts
  4. COMPREPLY=()
  5. cur="${COMP_WORDS[COMP_CWORD]}"
  6. opts="--help --verbose --debug --version --version-semver"
  7. case "$cur" in
  8. --*)
  9. COMPREPLY=(
  10. $(compgen -W "$opts" -- "${cur}")
  11. )
  12. ;;
  13. *)
  14. COMPREPLY=(
  15. $(compgen -W "$(satcmd _ls_sc)" "${cur}")
  16. )
  17. esac
  18. }
  19. complete -F __satcmd satcmd