My personal 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.

_cask 3.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #compdef cask
  2. # ------------------------------------------------------------------------------
  3. # Copyright (c) 2014 Github zsh-users - http://github.com/zsh-users
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions are met:
  8. # * Redistributions of source code must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. # * Redistributions in binary form must reproduce the above copyright
  11. # notice, this list of conditions and the following disclaimer in the
  12. # documentation and/or other materials provided with the distribution.
  13. # * Neither the name of the zsh-users nor the
  14. # names of its contributors may be used to endorse or promote products
  15. # derived from this software without specific prior written permission.
  16. #
  17. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  18. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  20. # DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY DIRECT, INDIRECT,
  21. # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  22. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  23. # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  24. # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  25. # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  26. # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. # ------------------------------------------------------------------------------
  28. # Description
  29. # -----------
  30. #
  31. # Completion script for cask (http://cask.readthedocs.org)
  32. #
  33. # ------------------------------------------------------------------------------
  34. # Authors
  35. # -------
  36. #
  37. # * ptrv <mail@petervasil.net>
  38. # * Johan Andersson <johan.rejeep@gmail.com>
  39. # * Sebastien Duthil <duthils@free.fr>
  40. #
  41. # ------------------------------------------------------------------------------
  42. function _cask() {
  43. local ret=1 state
  44. _arguments \
  45. ':subcommand:->subcommand' \
  46. '*:: :->subcmds' && ret=0
  47. case $state in
  48. subcommand)
  49. subcommands=(
  50. "build:build all Elisp files in the files directive"
  51. "clean-elc:remove all byte compiled Elisp files in the files directive"
  52. "exec:execute command with correct 'exec-path' and 'load-path'"
  53. "exec-path:print 'exec-path' for all packages and dependencies"
  54. "files:print list of files specified in the files directive"
  55. "help:display usage information or documentation for specified command"
  56. "info:show info about the current package"
  57. "init:initialize the current directory with a Cask-file"
  58. "install:install all packages specified in the Cask-file"
  59. "link:manage links"
  60. "list:list dependencies"
  61. "load-path:print 'load-path' for all packages and dependencies"
  62. "outdated:print list of outdated packages"
  63. "package:build package and put in specified directory (default: dist)"
  64. "package-directory:print current package installation directory"
  65. "path:print 'exec-path' for all packages and dependencies"
  66. "pkg-file:write a 'define-package' file"
  67. "update:update package version"
  68. "upgrade-cask:upgrade Cask itself and its dependencies"
  69. "upgrade:upgrade Cask itself and its dependencies"
  70. "version:print program version"
  71. )
  72. _describe -t subcommands 'cask subcommands' subcommands && ret=0
  73. esac
  74. case "$words[1]" in
  75. init)
  76. _arguments \
  77. '(--dev)--dev[Run in dev mode]' && ret=0 ;;
  78. exec)
  79. _generic
  80. ;;
  81. esac
  82. return ret
  83. }
  84. _cask "$@"