wp-cli.plugin.zsh 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. # WP-CLI
  2. # A command line interface for WordPress
  3. # https://wp-cli.org/
  4. # Cache
  5. # Cap
  6. # CLI
  7. # Comment
  8. # Core
  9. alias wpcc='wp core config'
  10. alias wpcd='wp core download'
  11. alias wpci='wp core install'
  12. alias wpcii='wp core is-installed'
  13. alias wpcmc='wp core multisite-convert'
  14. alias wpcmi='wp core multisite-install'
  15. alias wpcu='wp core update'
  16. alias wpcudb='wp core update-db'
  17. alias wpcvc='wp core verify-checksums'
  18. # Cron
  19. alias wpcre='wp cron event'
  20. alias wpcrs='wp cron schedule'
  21. alias wpcrt='wp cron test'
  22. # Db
  23. # Eval
  24. # Eval-File
  25. # Export
  26. # Help
  27. # Import
  28. # Media
  29. # Menu
  30. alias wpmc='wp menu create'
  31. alias wpmd='wp menu delete'
  32. alias wpmi='wp menu item'
  33. alias wpml='wp menu list'
  34. alias wpmlo='wp menu location'
  35. # Network
  36. # Option
  37. # Plugin
  38. alias wppa='wp plugin activate'
  39. alias wppda='wp plugin deactivate'
  40. alias wppd='wp plugin delete'
  41. alias wppg='wp plugin get'
  42. alias wppi='wp plugin install'
  43. alias wppis='wp plugin is-installed'
  44. alias wppl='wp plugin list'
  45. alias wppp='wp plugin path'
  46. alias wpps='wp plugin search'
  47. alias wppst='wp plugin status'
  48. alias wppt='wp plugin toggle'
  49. alias wppun='wp plugin uninstall'
  50. alias wppu='wp plugin update'
  51. # Post
  52. alias wppoc='wp post create'
  53. alias wppod='wp post delete'
  54. alias wppoe='wp post edit'
  55. alias wppogen='wp post generate'
  56. alias wppog='wp post get'
  57. alias wppol='wp post list'
  58. alias wppom='wp post meta'
  59. alias wppou='wp post update'
  60. alias wppourl='wp post url'
  61. # Rewrite
  62. # Role
  63. # Scaffold
  64. # Search-Replace
  65. # Shell
  66. # Sidebar
  67. alias wpsbl='wp sidebar list'
  68. # Site
  69. # Super-Admin
  70. # Term
  71. # Theme
  72. alias wpta='wp theme activate'
  73. alias wptd='wp theme delete'
  74. alias wptdis='wp theme disable'
  75. alias wpte='wp theme enable'
  76. alias wptg='wp theme get'
  77. alias wpti='wp theme install'
  78. alias wptis='wp theme is-installed'
  79. alias wptl='wp theme list'
  80. alias wptm='wp theme mod'
  81. alias wptp='wp theme path'
  82. alias wpts='wp theme search'
  83. alias wptst='wp theme status'
  84. alias wptu='wp theme updatet'
  85. # Transient
  86. # User
  87. alias wpuac='wp user add-cap'
  88. alias wpuar='wp user add-role'
  89. alias wpuc='wp user create'
  90. alias wpud='wp user delete'
  91. alias wpugen='wp user generate'
  92. alias wpug='wp user get'
  93. alias wpui='wp user import-csv'
  94. alias wpul='wp user list'
  95. alias wpulc='wp user list-caps'
  96. alias wpum='wp user meta'
  97. alias wpurc='wp user remove-cap'
  98. alias wpurr='wp user remove-role'
  99. alias wpusr='wp user set-role'
  100. alias wpuu='wp user update'
  101. # Widget
  102. alias wpwa='wp widget add'
  103. alias wpwda='wp widget deactivate'
  104. alias wpwd='wp widget delete'
  105. alias wpwl='wp widget list'
  106. alias wpwm='wp widget move'
  107. alias wpwu='wp widget update'
  108. autoload -U +X bashcompinit && bashcompinit
  109. # bash completion for the `wp` command
  110. _wp_complete() {
  111. local cur=${COMP_WORDS[COMP_CWORD]}
  112. IFS=$'\n'; # want to preserve spaces at the end
  113. local opts="$(wp cli completions --line="$COMP_LINE" --point="$COMP_POINT")"
  114. if [[ "$opts" =~ \<file\>\s* ]]
  115. then
  116. COMPREPLY=( $(compgen -f -- $cur) )
  117. elif [[ $opts = "" ]]
  118. then
  119. COMPREPLY=( $(compgen -f -- $cur) )
  120. else
  121. COMPREPLY=( ${opts[*]} )
  122. fi
  123. }
  124. complete -o nospace -F _wp_complete wp