From 7e85ffea332ee0b45a632dde0f8a3d8d90ca4549 Mon Sep 17 00:00:00 2001 From: jaseg Date: Mon, 1 Apr 2013 19:19:55 +0200 Subject: Added zsh and bash completion --- completion/zsh-completion.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 completion/zsh-completion.sh (limited to 'completion/zsh-completion.sh') diff --git a/completion/zsh-completion.sh b/completion/zsh-completion.sh new file mode 100644 index 0000000..4e280ba --- /dev/null +++ b/completion/zsh-completion.sh @@ -0,0 +1,29 @@ +#compdef ponysay ponythink +# +# this is zsh completion function file. +# generated by genzshcomp(ver: 0.5.1) +# + +typeset -A opt_args +local context state line + +local -a _available_ponies +(( $+functions[_ponysay_pony] )) || _ponysay_pony() +{ + (( $#_available_ponies )) || _available_ponies=($(ponysay -p list) ) + compadd "$@" -a _available_ponies +} + +_ponysay_balloons(){ + [[ "$words" == ponythink* ]] && compadd "$@" cowsay ascii || compadd "$@" cowsay ascii unicode round linux-vt +} + +_arguments -s -w -S \ + "(-h --help)"{-h,--help}"[show this help message and exit]" \ + "(-p= --pony=)"{-p,--pony}"[The name of the pony to be used. Use \"-p list\" to list all ponies, \"-p random\" (default) to use a random pony.]:PONY:_ponysay_pony" \ + "(-q --quote)"{-q,--quote}"[Use a random quote of the pony being displayed as text]" \ + "(-c --center)"{-c,--center}"[Center the pony]" \ + "(-C --center-text)"{-C,--center-text}"[Center the text in the bubble]" \ + "(-w= --width=)"{-w,--width}"[Terminal width. Use 0 for unlimited width. Default: autodetect]:WIDTH: " \ + "(-b= --balloon=)"{-b,--balloon}"[Balloon style to use. Use \"-b list\" to list available styles.]:BALLOON:_ponysay_balloons" + -- cgit