diff options
Diffstat (limited to 'useful/zsh-completion/openslx/_mltk')
-rw-r--r-- | useful/zsh-completion/openslx/_mltk | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/useful/zsh-completion/openslx/_mltk b/useful/zsh-completion/openslx/_mltk new file mode 100644 index 00000000..fccceb1b --- /dev/null +++ b/useful/zsh-completion/openslx/_mltk @@ -0,0 +1,42 @@ +#compdef mltk +#autoload + +typeset -A opt_args +local context state state_descr line expl + +_mltk_target_modules() { + target_modules=(`ls remote/targets/$1`) +} + +local -a targets target_modules +_targets=(`ls remote/targets`) + +_arguments \ + "--help[display help text]: :->help" \ + "-n[-n \[name\] bind mount all the local builds (remote/builds) to /export/builds or /export/\[name\]]: :->bind" \ + "*:: :->target" && return 0 + +if (( CURRENT == 1 )); then + _describe -t commands "mltk Targets" _targets + return +fi + +case "$state" in + target) + _mltk_target_modules $words[1] + _arguments \ + "-c[-c \[module\]* clean build directory of module(s) and target dir]:*: :->modules" \ + "-b[-b \[module\]* build module(s) and copy them to the target build directory]:*: :->modules" \ + "-d[activates debug output for the task (spamy)]" \ + && return 0 + + + if [[ "$state" == modules ]]; then + _arguments \ + "-c[-c \[module\]* clean build directory of module(s) and target dir]" \ + "-b[-b \[module\]* build module(s) and copy them to the target build directory]" \ + "-d[activates debug output for the task (spamy)]: :->debug" \ + "*:Modules in Target $words[1]:($target_modules)" && return 0 + fi + ;; +esac |