# config-edit(1) completion
#
#
# This file is part of Config-Model
#
# This software is Copyright (c) 2010 by Dominique Dumont
#
# This is free software, licensed under:
#
# The GNU Lesser General Public License, Version 2.1, February 1999
#
_config-edit_models()
{
MODELS=$(perl -MConfig::Model::Lister -e'print Config::Model::Lister::models;')
COMPREPLY=( $( compgen -W "$MODELS" -- $cur ) )
}
_config-edit_appli()
{
MODELS=$(perl -MConfig::Model::Lister -e'print Config::Model::Lister::applications;')
COMPREPLY=( $( compgen -W "$MODELS" -- $cur ) )
}
_config-edit_options()
{
COMPREPLY=( $( compgen -W '-application -model -ui -dev -model-dir -root-dir -force-load -backend -dump -dumptype -load -save -fuse-dir -search -narrow-search' -- $cur ) )
}
_config-edit()
{
local cur
COMPREPLY=()
_get_comp_words_by_ref -n : cur prev
case $prev in
-application)
_config-edit_appli
;;
-model)
_config-edit_models
;;
-ui)
compgen -W 'none tk curses shell fuse' -- $cur
;;
-model-dir|-root-dir|-fuse-dir)
_filedir -d
;;
-dumptype)
compgen -W 'full preset custom' -- $cur
;;
-load)
_filedir '.cds'
;;
esac
if [[ $COMP_CWORD -eq 1 ]] ; then
_config-edit_options
else
return 0
fi
}
complete -F _config-edit config-edit