aboutsummaryrefslogtreecommitdiffstats
path: root/src/_showoff
diff options
context:
space:
mode:
authorJulien Nicoulaud <julien.nicoulaud@gmail.com>2012-08-01 13:23:11 +0200
committerJulien Nicoulaud <julien.nicoulaud@gmail.com>2012-08-01 13:23:11 +0200
commit10ffeb0c153258896531b2b8939e94486d58b378 (patch)
treef735059d34c7f2ade7eb410643f39ecf402833d9 /src/_showoff
parentAdd call for deb and rpm packagers (diff)
downloadzsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.tar
zsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.tar.gz
zsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.tar.bz2
zsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.tar.lz
zsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.tar.xz
zsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.tar.zst
zsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.zip
[BREAKING CHANGE] Move compdefs to own directory (to ease packaging and
avoid bloating users fpath with unneeded files such as README.md)
Diffstat (limited to 'src/_showoff')
-rw-r--r--src/_showoff79
1 files changed, 79 insertions, 0 deletions
diff --git a/src/_showoff b/src/_showoff
new file mode 100644
index 0000000..0ba0f36
--- /dev/null
+++ b/src/_showoff
@@ -0,0 +1,79 @@
+#compdef showoff
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Showoff (https://github.com/schacon/showoff).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Bruno Michel (https://github.com/nono)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+local curcontext="$curcontext" state line cmds ret=1
+
+_arguments -C \
+ '1: :->cmds' \
+ '*: :->args' && ret=0
+
+case $state in
+ cmds)
+ cmds=(
+ 'add:Add a new slide at the end in a given dir'
+ 'new:Add a new slide at the end in a given dir'
+ 'create:Create new showoff presentation'
+ 'init:Create new showoff presentation'
+ 'help:Shows list of commands or help for one command'
+ 'heroku:Setup your presentation to serve on Heroku'
+ 'serve:Serves the showoff presentation in the current directory'
+ 'static:Generate static version of presentation'
+ )
+ _describe -t commands 'showoff command' cmds && ret=0
+ ;;
+ args)
+ case $line[1] in
+ (add|new)
+ _arguments \
+ '(-d --dir)'{-d,--dir}'=[Slide dir (where to put a new slide file)]:directory:_files' \
+ '(-n --name)'{-n,--name}'=[Slide name (name of the new slide file)]:basename' \
+ {-s,--source}'=[Include code from the given file as the slide body]:file:_files' \
+ '(-t --style --type)'{-t,--style,--type}'=[Slide Type/Style (default: title)]:style' \
+ '(-u --no-number)'{-u,--no-number}'[Dont number the slide, use the given name verbatim]' \
+ '1:title' && ret=0
+ ;;
+ (create|init)
+ _arguments \
+ '(-d --slidedir)'{-d,--slidedir}'=[Sample slide directory name (default: one)]:arg' \
+ '(-n --nosamples)'{-n,--nosamples}'=[Dont create sample slides]' \
+ '1:dir_name' && ret=0
+ ;;
+ help)
+ _values 'commands' add new create init help heroku serve static && ret=0
+ ;;
+ heroku)
+ _message 'please entrer an heroku_name' && ret=0
+ ;;
+ serve)
+ _arguments \
+ '(-h --host)'{-h,--host}'=[Host or ip to run on (default: localhost)]:host' \
+ '(-p --port)'{-p,--port}'=[Port on which to run (default: 9090)]:port' \
+ '1:title' && ret=0
+ ;;
+ static)
+ _message 'please entrer a name' && ret=0
+ ;;
+ *)
+ (( ret )) && _message 'no more arguments'
+ ;;
+ esac
+ ;;
+esac
+
+return ret