my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
593 B

3 years ago
  1. #compdef spring 'spring'
  2. #autoload
  3. _spring() {
  4. local cword
  5. let cword=CURRENT-1
  6. local hints
  7. hints=()
  8. local reply
  9. while read -r line; do
  10. reply=`echo "$line" | awk '{printf $1 ":"; for (i=2; i<NF; i++) printf $i " "; print $NF}'`
  11. hints+=("$reply")
  12. done < <(spring hint ${cword} ${words[*]})
  13. if ((cword == 1)) {
  14. _describe -t commands 'commands' hints
  15. return 0
  16. }
  17. _describe -t options 'options' hints
  18. _files
  19. return 0
  20. }
  21. _spring "$@"