| 1 |
# cme(1) completion -*- shell-script -*- |
| 2 |
# |
| 3 |
# |
| 4 |
# This file is part of Config::Model::Itself |
| 5 |
# |
| 6 |
# This software is Copyright (c) 2015 by Dominique Dumont |
| 7 |
# |
| 8 |
# This is free software, licensed under: |
| 9 |
# |
| 10 |
# The GNU Lesser General Public License, Version 2.1, February 1999 |
| 11 |
# |
| 12 |
|
| 13 |
|
| 14 |
_cme_cmd_meta() |
| 15 |
{ |
| 16 |
local cur |
| 17 |
|
| 18 |
COMPREPLY=() |
| 19 |
_get_comp_words_by_ref -n : cur prev |
| 20 |
|
| 21 |
global_options='-dev -force-load -create -backend -trace -quiet -file' |
| 22 |
|
| 23 |
if [[ $COMP_CWORD -eq 2 ]] ; then |
| 24 |
COMPREPLY=( $( compgen -W 'edit check save plugin dump dump-yaml gen-dot' -- $cur ) ) |
| 25 |
elif [[ $COMP_CWORD -eq 3 ]] ; then |
| 26 |
MODELS=$(/usr/bin/perl -MConfig::Model::Lister -e'print Config::Model::Lister::applications(1);') |
| 27 |
COMPREPLY=( $( compgen -W "$MODELS" -- $cur ) ) |
| 28 |
elif [[ $COMP_CWORD -eq 4 ]] ; then |
| 29 |
OPTIONS='-dir -dumptype -open-item -plugin-file -load-yaml -load -system' |
| 30 |
COMPREPLY=( $( compgen -W "$OPTIONS" -- $cur ) ) |
| 31 |
else |
| 32 |
case $prev in |
| 33 |
-dir|-open-item|-plugin-file|-load-yaml|-load) |
| 34 |
_filedir -d |
| 35 |
;; |
| 36 |
-dumptype) |
| 37 |
COMPREPLY=( $( compgen -W 'full preset custom' -- $cur ) ) |
| 38 |
;; |
| 39 |
*) |
| 40 |
esac |
| 41 |
fi |
| 42 |
true; |
| 43 |
} |
| 44 |
|