From 2c8b5c99f05ecadb59a9feff98ed442e33ca9c44 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 26 Feb 2016 15:01:41 +0200 Subject: [PATCH] Add autocomplete for vagga --- plugins/vagga/_vagga | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 plugins/vagga/_vagga diff --git a/plugins/vagga/_vagga b/plugins/vagga/_vagga new file mode 100644 index 000000000..7eda51e0e --- /dev/null +++ b/plugins/vagga/_vagga @@ -0,0 +1,26 @@ +#compdef vagga +#autoload + +# This implements autocomplete for vagga daemonless containerization tool +# src: https://github.com/tailhook/vagga +# doc: https://vagga.readthedocs.org/ + +_get_vagga_commands() { + vagga 2>&1 | sed '0,/Available commands:/d' | sed 's/^\s*//' +} + +local -a _vagga_commands + +_vagga_commands=($(_get_vagga_commands)) + +_arguments \ + '(-h --help)'{-h,--help}'[show this help message and exit]' \ + '(-V --version)'{-V,--version}'[Show vagga version and exit]' \ + '(-E --env --environ)'{-E,--env,--environ}'[NAME=VALUE Set environment variable for running command]:environment variable KEY=VAL: ' \ + '(-e --use-env)'{-e,--use-env}'[VAR Propagate variable VAR into command environment]:environment variable VAR: ' \ + '(--ignore-owner-check)--ignore-owner-check[Ignore checking owner of the project directory]' \ + "(--no-build)--no-build[Do not build container even if it is out of date. Return error code 29 if it's out of date.]" \ + '(--no-version-check)--no-version-check[Do not run versioning code, just pick whatever container version with the name was run last (or actually whatever is symlinked under `.vagga/container_name`). Implies `--no-build`]' \ + '*:: :->subcommand' && return 0 + +_describe -t commands "vagga subcommand" _vagga_commands