Salome HOME
Add test for the compilation commands
[tools/sat.git] / complete_sat.sh
index fc03d4ef1e9ed423176c7752e3483c9d622230cb..c258f901d94f2950c91ed23fb08e3d3a6e366150 100755 (executable)
@@ -26,7 +26,7 @@ _show_applications()
             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)
@@ -39,6 +39,17 @@ _show_applications()
     COMPREPLY=( $(compgen -W "${opts2}" -- ${cur}) )
 }
 
+_show_products()
+{
+    if [[ $appli != $prev ]]
+    then
+        opts=$(for x in `$SAT_PATH/sat -s config $appli -nv APPLICATION.products`
+            do echo ${x}; done)
+
+        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+   fi
+}
+
 _salomeTools_complete()
 {
     if [[ "${SAT_PATH}x" == "x" ]]
@@ -69,7 +80,7 @@ _salomeTools_complete()
     # first argument => show available commands
     if [[ ${argc} == 1 ]]
     then
-        opts="config log testcommand --help"
+        opts="config log testcommand source patch prepare environ clean configure make makeinstall compile --help"
         COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
         return 0
     fi
@@ -101,19 +112,19 @@ _salomeTools_complete()
         
         return 0
     fi
-
-    # show list of softwares
-    if [[ ${prev} == "--module" || ${prev} == "-m" ]]
+      
+    # show list of products
+    if [[ ${prev} == "--product" || ${prev} == "-p" ]]
     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.products`
                 do echo ${x}; done)
 
                COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
             return 0
-           fi
+        fi
     fi
 
     # show argument for each command
@@ -128,12 +139,57 @@ _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="--products"
+            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+            return 0
+            ;;
+        patch)
+            opts="--products"
+            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+            return 0
+            ;;
+        prepare)
+            opts="--products --force --force_patch"
+            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+            return 0
+            ;;
+        environ)
+            opts="--products --shell --prefix --target"
+            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+            return 0
+            ;;
+        configure)
+            opts="--products --option"
+            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+            return 0
+            ;;
+        make)
+            opts="--products --option"
+            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+            return 0
+            ;;
+        makeinstall)
+            opts="--products"
+            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+            return 0
+            ;;
+        compile)
+            opts="--products --with_fathers --with_children --clean_all --make_flags --show --stop_first_fail"
+            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+            return 0
+            ;;
         *) return 0 ;;
     esac
     
 }
 
-# activation de l'auto-completion pour la commande sat
+# activation of auto-completion for the sat command
 complete -F _salomeTools_complete sat
 complete -F _salomeTools_complete ./sat