diff options
| author | Robby Russell <robby@planetargon.com> | 2013-04-07 19:02:58 -0700 | 
|---|---|---|
| committer | Robby Russell <robby@planetargon.com> | 2013-04-07 19:02:58 -0700 | 
| commit | 3726c495969639b74030143e59e982c4b305d95a (patch) | |
| tree | 50c03473e2f623e97d21400e548b37f28b4b688e /plugins/powify | |
| parent | eadca724b7251ffb608b7b5bc0d0607c37e1c4a9 (diff) | |
| parent | 8d6b7573e77abf2fb114579806e6e749bef5eca5 (diff) | |
| download | zsh-3726c495969639b74030143e59e982c4b305d95a.tar.gz zsh-3726c495969639b74030143e59e982c4b305d95a.tar.bz2 zsh-3726c495969639b74030143e59e982c4b305d95a.zip  | |
Merge pull request #1680 from zbrox/master
Powify autocomplete
Diffstat (limited to 'plugins/powify')
| -rw-r--r-- | plugins/powify/_powify | 55 | 
1 files changed, 55 insertions, 0 deletions
diff --git a/plugins/powify/_powify b/plugins/powify/_powify new file mode 100644 index 000000000..d23c46513 --- /dev/null +++ b/plugins/powify/_powify @@ -0,0 +1,55 @@ +#compdef powify + +_powify_all_servers() { +  all_servers=(`ls $HOME/.pow/`) +} + +local -a all_servers + +local -a _1st_arguments +_1st_arguments=( +  'server:server specific commands' +  'utils:manage powify' +  'create:creates a pow app from the current directory (to change the name append name as an argument)' +  'destroy:destroys the pow app linked to the current directory' +  'restart:restarts the pow app linked to the current directory' +  'always_restart:reload the pow app after each request' +  'always_restart_off:do not reload the pow app after each request' +  'rename:rename the current pow app to [NAME] or renmae [OLD] to [NEW]' +  'environment:run the this pow app in a different environment (aliased `env`)' +  'browse:opens and navigates the default browser to this app' +  'logs:tail the application logs' +) + +_arguments '*:: :->command' + +if (( CURRENT == 1 )); then +  _describe -t commands "powify command" _1st_arguments +  return +fi + +case "$words[1]" in +  server) +    _values \ +      'install[install pow server]' \ +      'reinstall[reinstall pow server]' \ +      'update[update pow server]' \ +      'uninstall[uninstall pow server]' \ +      'list[list all pow apps]' \ +      'start[start the pow server]' \ +      'stop[stop the pow server]' \ +      'restart[restart the pow server]' \ +      'host[adds all pow apps to /etc/hosts file]' \ +      'unhost[removes all pow apps from /etc/hosts file]' \ +      'status[print the current server status]' \ +      'config[print the current server configuration]' \ +      'logs[tails the pow server logs]' ;; +  utils) +    _values \ +      'install[install powify.dev server management tool]' \ +      'reinstall[reinstall powify.dev server management tool]' \ +      'uninstall[uninstall powify.dev server management tool]' ;; +  destroy|restart|always_restart|always_restart_off|rename|browse|logs) +    _powify_all_servers +    _wanted all_servers expl 'all pow servers' compadd -a all_servers ;; +esac  | 
