cargo.plugin.zsh 607 B

12345678910111213141516171819202122
  1. function _cargo_commands() {
  2. local ret=1 state
  3. _arguments ':subcommand:->subcommand' && ret=0
  4. case $state in
  5. subcommand)
  6. subcommands=(
  7. "build:Build the current project"
  8. "clean:Clean up after a build"
  9. "help:Help about available commands"
  10. "new:Create a new project"
  11. "test:Run the tests"
  12. "update:Updates list of known packages"
  13. "run:Builds and runs the currecnt project"
  14. )
  15. _describe -t subcommands 'cargo subcommands' subcommands && ret=0
  16. esac
  17. return ret
  18. }
  19. compdef _cargo_commands cargo