# Define all possible option for log command : sat log <options>
parser = src.options.Options()
parser.add_option('m', 'module', 'list2', 'modules',
- _('modules to get the sources. This option can be'
+ _('modules from which to get the sources. This option can be'
' passed several time to get the sources of several modules.'))
parser.add_option('', 'no_sample', 'boolean', 'no_sample',
_("do not get sources from sample modules."))
return good_result, results
+def description():
+ '''method that is called when salomeTools is called with --help option.
+
+ :return: The text to display for the source command description.
+ :rtype: str
+ '''
+ return _("The source command gets the sources of the application modules "
+ "from cvs, git, an archive or a directory..")
+
def run(args, runner, logger):
'''method that is called when salomeTools is called with source parameter.
'''
echo ${x}
done)
- # additional options for command working without products
+ # additional options for command working without applications
case "${command}" in
config)
opts2=$(echo --list --value --edit --info $opts2)
COMPREPLY=( $(compgen -W "${opts2}" -- ${cur}) )
}
+_show_modules()
+{
+ if [[ $appli != $prev ]]
+ then
+ opts=$(for x in `$SAT_PATH/sat -s config $appli -nv APPLICATION.modules`
+ do echo ${x}; done)
+
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ fi
+}
+
_salomeTools_complete()
{
if [[ "${SAT_PATH}x" == "x" ]]
# first argument => show available commands
if [[ ${argc} == 1 ]]
then
- opts="config log testcommand --help"
+ opts="config log testcommand source patch --help"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
return 0
fi
-
- # show list of softwares
+
+ # show list of modules
if [[ ${prev} == "--module" || ${prev} == "-m" ]]
then
- prod="${COMP_WORDS[2]}"
- if [[ ${command} != "test" ]]
+ appli="${COMP_WORDS[2]}"
+ if [[ ${command} != "source" ]]
then
- opts=$(for x in `$SAT_PATH/sat config $prod -nv PRODUCT.softwares`
+ opts=$(for x in `$SAT_PATH/sat config $appli -nv APPLICATION.modules`
do echo ${x}; done)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
- fi
+ fi
fi
# show argument for each command
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
+ source)
+ opts="--modules --no_sample --force"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
*) return 0 ;;
esac