\tIf a name is given the new config file takes the given name."""))
parser.add_option('n', 'no_label', 'boolean', 'no_label',
_("Internal use: do not print labels, Works only with --value and --list."))
+parser.add_option('', 'completion', 'boolean', 'completion',
+ _("Internal use: print only keys, works only with --value."))
parser.add_option('s', 'schema', 'boolean', 'schema',
_("Internal use."))
src.printcolors.printcLabel(runner.cfg.VARS.application), 3)
logger.write("\n", 2, False)
show_patchs(runner.cfg, logger)
+
+ # case: print all the products name of the application (internal use for completion)
+ elif options.completion:
+ for product_name in runner.cfg.APPLICATION.products.keys():
+ logger.write("%s\n" % product_name)
{
if [[ $appli != $prev ]]
then
- opts=$(for x in `$SAT_PATH/sat -s config $appli -nv APPLICATION.products`
+ opts=$(for x in `$SAT_PATH/sat config $appli --completion`
do echo ${x}; done)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
fi
# show list of products
- if [[ ${prev} == "--product" || ${prev} == "-p" ]]
+ if [[ ${prev} == "--product" || ${prev} == "-p" || ${prev} == "--info" || ${prev} == "-i" ]]
then
appli="${COMP_WORDS[2]}"
if [[ ${command} != "source" ]]
then
- opts=$(for x in `$SAT_PATH/sat config $appli -nv APPLICATION.products`
+ opts=$(for x in `$SAT_PATH/sat config $appli --completion`
do echo ${x}; done)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )