Repository : http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
commit 92195374e319145755bcc65bd0d8ef358b35235a Author: Peter Hatina phatina@redhat.com Date: Tue Oct 22 12:28:17 2013 +0200
introduce zsh completion
cli/completion/README_zsh.md | 12 ++++++++++++ cli/completion/_lmishell | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/cli/completion/README_zsh.md b/cli/completion/README_zsh.md new file mode 100644 index 0000000..3c66c06 --- /dev/null +++ b/cli/completion/README_zsh.md @@ -0,0 +1,12 @@ +# OpenLMI Shell Completion for Zsh +Supplied completion function defined in `_lmishell` supports completion of all +command line arguments of `lmishell`. The completion also works for script +filename completion with `.lmi` or `.py` extension. + +## Setup +To use the completion, it is necessary to place `_lmishell` into `fpath`. + +You need to modify your `zshrc`, so it contains following line: +```sh +autoload -U compinit && compinit +``` diff --git a/cli/completion/_lmishell b/cli/completion/_lmishell new file mode 100644 index 0000000..f6e7c33 --- /dev/null +++ b/cli/completion/_lmishell @@ -0,0 +1,35 @@ +#compdef lmishell + +# Copyright (C) 2013 Red Hat, Inc. All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Authors: Peter Hatina phatina@redhat.com +# +# Zsh completion for OpenLMI Shell + +_lmishell() { + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + '(- 1 *)'{-h,--help}'[print help message and exit]' \ + '(- 1 *):OpenLMI Shell Script:_files -g *.(lmi|py)' \ + '(-i --interact)'{-i,--interact}'[inspect interactively after running a script]' \ + '(-v --verbose)'{-v,--verbose}'[print log messages to stderr]' \ + '(-m --more-verbose)'{-m,--more-verbose}'[print all log messages to stderr]' \ + '(-q --quiet)'{-q,--quiet}'[do not print any log messages to stderr]' \ + '(-n --noverify)'{-n,--noverify}'[do not verify CIMOM SSL certificate]' +}
cura-tools-devel@lists.fedorahosted.org