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.

_ansible-galaxy 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. #compdef ansible-galaxy
  2. # ------------------------------------------------------------------------------
  3. # Copyright (c) 2011 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" AND
  18. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  19. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  20. # DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
  21. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  22. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  24. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  26. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. # ------------------------------------------------------------------------------
  28. # Description
  29. # -----------
  30. #
  31. # Completion script for ansible-galaxy v2.0.0.2 (http://ansible.org)
  32. #
  33. # ------------------------------------------------------------------------------
  34. # Authors
  35. # -------
  36. #
  37. # * Romain Bossart (https://github.com/bosr)
  38. # * Adam Stevko (https://github.com/xen0l)
  39. #
  40. # ------------------------------------------------------------------------------
  41. #
  42. # Note: I tried to use `_arguments --`, but the output of `ansible --help`
  43. # is not parsed entirely correctly, and anyway no modules or host would available.
  44. #
  45. # ansible-galaxy zsh completion
  46. #
  47. _ansible-galaxy ()
  48. {
  49. local context curcontext="$curcontext" state line
  50. typeset -A opt_args
  51. _arguments -C \
  52. "1:command:(delete import info init install list login remove search setup)" \
  53. "*::option:->option"
  54. case $state in
  55. option)
  56. case $line[1] in
  57. delete)
  58. _arguments \
  59. "(-h --help)"{-h,--help}"[help message]" \
  60. "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
  61. "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
  62. "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
  63. "--version[show program's version number and exit]" \
  64. ":github_user:(GITHUB_USER)" \
  65. ":github_repo:(GITHUB_REPO)"
  66. ;;
  67. import)
  68. _arguments \
  69. "--branch[REFERENCE The name of a branch to import.]:reference:(master)" \
  70. "(-h --help)"{-h,--help}"[help message]" \
  71. "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
  72. "--no-wait[Don't wait for import results.]" \
  73. "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
  74. "--status[Check the status of the most recent import request forgiven github_user/github_repo.]" \
  75. "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
  76. "--version[show program's version number and exit]" \
  77. ":github_user:(GITHUB_USER)" \
  78. ":github_repo:(GITHUB_REPO)"
  79. ;;
  80. info)
  81. _arguments \
  82. "(-h --help)"{-h,--help}"[help message]" \
  83. "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
  84. "(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \
  85. "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
  86. "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
  87. "--version[show program's version number and exit]" \
  88. ":role name:(ROLE,version)"
  89. ;;
  90. init)
  91. _arguments \
  92. "(-f --force)"{-f,--force}"[ Force overwriting an existing role]" \
  93. "(-h --help)"{-h,--help}"[help message]" \
  94. "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
  95. "(-p --init-path)"{-p,--init-path}"[INIT_PATH path in which the skeleton role will be created (default=./)]:init path:(./)" \
  96. "(--offline)--offline[Don't query the galaxy API when creating roles]" \
  97. "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
  98. "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
  99. "--version[show program's version number and exit]" \
  100. ":role name:(ROLE)"
  101. ;;
  102. install)
  103. _arguments \
  104. "(-f --force)"{-f,--force}"[Force overwriting an existing role]" \
  105. "(-h --help)"{-h,--help}"[help message]" \
  106. "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
  107. "(-i --ignore-errors)"{-i,--ignore-errors}"[Ignore errors and continue with the next specified role]" \
  108. "(-n --no-deps)"{-n,--no-deps}"[Don't download roles listed as dependencies]" \
  109. "(-r --role-file)"{-r,--role-file}"[ROLE_FILE A file containing a list of roles to be imported]:role file:_files" \
  110. "(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \
  111. "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
  112. "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
  113. "--version[show program's version number and exit]" \
  114. ":role name:(ROLE)"
  115. ;;
  116. list)
  117. _arguments \
  118. "(-h --help)"{-h,--help}"[help message]" \
  119. "(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \
  120. "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
  121. "--version[show program's version number and exit]" \
  122. ":role name:(ROLE)"
  123. ;;
  124. login)
  125. _arguments \
  126. "--github_token[TOKEN Identify with github token rather than username and password.]:token:(TOKEN)" \
  127. "(-h --help)"{-h,--help}"[help message]" \
  128. "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
  129. "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
  130. "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
  131. "--version[show program's version number and exit]"
  132. ;;
  133. remove)
  134. _arguments \
  135. "(-h --help)"{-h,--help}"[help message]" \
  136. "(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \
  137. "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
  138. "--version[show program's version number and exit]" \
  139. "*:role name:(ROLE)"
  140. ;;
  141. search)
  142. _arguments \
  143. "--author[AUTHOR GitHub username]:author:(AUTHOR)" \
  144. "--galaxy-tags[TAGS list of galaxy tags to filter by]:tags:(TAGS)" \
  145. "(-h --help)"{-h,--help}"[help message]" \
  146. "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
  147. "--platforms[PLATFORMS list of OS platforms to filter by" \
  148. "(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \
  149. "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
  150. "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
  151. "--version[show program's version number and exit]"
  152. ;;
  153. setup)
  154. _arguments \
  155. "(-h --help)"{-h,--help}"[help message]" \
  156. "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
  157. "--list[List all of your integrations.]" \
  158. "--remove[REMOVE_ID Remove the integration matching the provided ID value.]:id:(REMOVE_ID)" \
  159. "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
  160. "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
  161. "--version[show program's version number and exit]" \
  162. ":source:(travis)" \
  163. ":github_user:(GITHUB_USER)" \
  164. ":github_repo:(GITHUB_REPO)" \
  165. ":secret:(SECRET)"
  166. ;;
  167. esac
  168. ;;
  169. esac
  170. }
  171. _ansible-galaxy "$@"
  172. # Local Variables:
  173. # mode: Shell-Script
  174. # sh-indentation: 2
  175. # indent-tabs-mode: nil
  176. # sh-basic-offset: 2
  177. # End:
  178. # vim: ft=zsh sw=2 ts=2 et