From 747e97f705b1477bb5600dfc796bb29b00a15b1f Mon Sep 17 00:00:00 2001 From: Serge Rehbinder Date: Tue, 17 May 2016 10:10:20 +0200 Subject: [PATCH] update completion --- commands/clean.py | 4 ++-- commands/patch.py | 2 +- commands/prepare.py | 8 ++++---- commands/source.py | 2 +- complete_sat.sh | 13 +++++++++---- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/commands/clean.py b/commands/clean.py index 03b9342..eb3ccfa 100644 --- a/commands/clean.py +++ b/commands/clean.py @@ -32,7 +32,7 @@ parser = src.options.Options() parser.add_option('p', 'products', 'list2', 'products', _('products to clean. This option can be' ' passed several time to clean several products.')) -parser.add_option('s', 'source', 'boolean', 'source', +parser.add_option('s', 'sources', 'boolean', 'sources', _("Clean the product source directories.")) parser.add_option('b', 'build', 'boolean', 'build', _("Clean the product build directories.")) @@ -160,7 +160,7 @@ def run(args, runner, logger): if options.build: l_dir_to_suppress += get_build_directories(products_infos) - if options.source or options.sources_without_dev: + if options.sources or options.sources_without_dev: l_dir_to_suppress += get_source_directories(products_infos, options.sources_without_dev) diff --git a/commands/patch.py b/commands/patch.py index fec8f9f..30b7332 100644 --- a/commands/patch.py +++ b/commands/patch.py @@ -24,7 +24,7 @@ import prepare # Define all possible option for patch command : sat patch parser = src.options.Options() -parser.add_option('p', 'product', 'list2', 'products', +parser.add_option('p', 'products', 'list2', 'products', _('products to get the sources. This option can be' ' passed several time to get the sources of several products.')) diff --git a/commands/prepare.py b/commands/prepare.py index 073e980..7e18a2f 100644 --- a/commands/prepare.py +++ b/commands/prepare.py @@ -22,7 +22,7 @@ import src # Define all possible option for prepare command : sat prepare parser = src.options.Options() -parser.add_option('p', 'product', 'list2', 'products', +parser.add_option('p', 'products', 'list2', 'products', _('products to prepare. This option can be' ' passed several time to prepare several products.')) parser.add_option('f', 'force', 'boolean', 'force', @@ -103,7 +103,7 @@ def run(args, runner, logger): # Construct the arguments to pass to the clean, source and patch commands args_appli = runner.cfg.VARS.application + ' ' - args_product_opt = '--product ' + args_product_opt = '--products ' if options.products: for p_name in options.products: args_product_opt += ',' + p_name @@ -136,13 +136,13 @@ def run(args, runner, logger): logger.write("\n", 1) # Construct the final commands arguments - args_clean = args_appli + args_product_opt_clean + " --source" + args_clean = args_appli + args_product_opt_clean + " --sources" args_source = args_appli + args_product_opt args_patch = args_appli + args_product_opt_patch # If there is no more any product in the command arguments, # do not call the concerned command - oExpr = re.compile("^--product *$") + oExpr = re.compile("^--products *$") do_clean = not(oExpr.search(args_product_opt_clean)) do_source = not(oExpr.search(args_product_opt)) do_patch = not(oExpr.search(args_product_opt_patch)) diff --git a/commands/source.py b/commands/source.py index 9e086e8..79068ce 100644 --- a/commands/source.py +++ b/commands/source.py @@ -24,7 +24,7 @@ import prepare # Define all possible option for patch command : sat patch parser = src.options.Options() -parser.add_option('p', 'product', 'list2', 'products', +parser.add_option('p', 'products', 'list2', 'products', _('products from which to get the sources. This option can be' ' passed several time to get the sources of several products.')) diff --git a/complete_sat.sh b/complete_sat.sh index c56bb38..11aaed3 100755 --- a/complete_sat.sh +++ b/complete_sat.sh @@ -80,7 +80,7 @@ _salomeTools_complete() # first argument => show available commands if [[ ${argc} == 1 ]] then - opts="config log testcommand source patch prepare environ --help" + opts="config log testcommand source patch prepare environ clean --help" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 fi @@ -139,18 +139,23 @@ _salomeTools_complete() COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; + clean) + opts="--products --sources --build --install --all --sources_without_dev" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + ;; source) - opts="--product --no_sample --force" + opts="--products" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; patch) - opts="--product --no_sample" + opts="--products" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; prepare) - opts="--product --no_sample --force --force_patch" + opts="--products --force --force_patch" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; -- 2.30.2