_cu 992 B

1234567891011121314151617181920212223242526272829303132
  1. #compdef cu
  2. # Completion for the Call Up (cu) command
  3. #
  4. # More info:
  5. # `man zshcompsys`
  6. # http://www.linux-mag.com/id/1106/
  7. # Standard completion variables:
  8. local state # Gets set to a value when an argument action starts with `->`
  9. # Argument line format:
  10. # (option-exclusions)option[description]:Help-text-in-verbose-mode:action
  11. #
  12. # `option` can be followed by a symbol (e.g. `+`, `=`) to define how option
  13. # values can be written . Look up `_arguments` in the `zshcompsys` manpage.
  14. #
  15. # `action` can be blank, a list of values, or additional completion logic.
  16. #
  17. _arguments \
  18. "-s+[baud rate]:Symbol transfer speed, depending on device:(9600)" \
  19. "-l+[call-up line to listen to]:Device starting with 'cu':->line"
  20. case $state in
  21. (line)
  22. # `_files` is a general filepath completion helper
  23. # `-W` = working directory
  24. # `-g` = regexp filter
  25. # All completion actions should return `0` on success and non-zero on error.
  26. _files -W /dev -g 'cu\.*' && return 0
  27. ;;
  28. esac