Index: trunk/src/project_profile.sh
===================================================================
--- trunk/src/project_profile.sh	(revision 13)
+++ trunk/src/project_profile.sh	(revision 14)
@@ -104,5 +104,5 @@
 # ++ besoin de posix
 #
-# ++ pas de MANPATH defini par défaut sur cratos et cerbere
+# ++ pas de MANPATH defini par dÃ©faut sur cratos et cerbere
 #
 # EVOLUTIONS
@@ -140,170 +140,202 @@
 usage=" Usage : ${command} -d directory -i indir -o outdir -t tempdir -s saxo_dir"
 #
-while [ ${#} -gt 0 ]
-do
-    case ${1} in
-        -d)
-            # directory for application choosen by user
-            # (see svn checkout command used)
-            directory=${2}
-            shift
-        ;;
-        -i)
-            # directory for inputs choosen by user
-            indir=${2}
-            shift
-        ;;
-        -o)
-            # directory for outputs choosen by user
-            outdir=${2}
-            shift
-        ;;
-        -t)
-            # directory for temporary outputs choosen by user
-            tempdir=${2}
-            shift
-        ;;
-        -s)
-            saxo_dir=${2}
-            shift
-        ;;
-        *)
-            # other choice
-            echo "eee : unknown option ${1}"
-            echo "${usage}"
-            # nb : no exit because this file should be launched
-            # by login process
-        ;;
-    esac
-    # next flag
-    shift
-done
-unset usage
-#
-# check for ${directory}
-if [ ! -d ${directory} ]
+pb=0
+#
+minargcount=10
+maxargcount=10
+narg=${#}
+#
+if [ ${narg} -lt ${minargcount} ]
 then
-    echo " eee : ${directory} not found"
+    echo "eee : not enought arguments (${narg} vs ${minargcount})"
+    echo "${usage}"
     # nb : no exit because this file should be launched by login process
+    pb=1
 fi
-#
-# check for permission on directory
-if [ ! -x ${directory} ]
+unset minargcount
+#
+if [ ${narg} -gt ${maxargcount} ]
 then
-    echo " eee : ${directory} not reachable"
+    echo "eee : too many arguments (${narg} vs ${maxargcount})"
+    echo "${usage}"
     # nb : no exit because this file should be launched by login process
+    pb=1
 fi
-#
-PROJECT=${directory}
-export PROJECT
-unset drectory
-#
-# add PROJECT tools to PATH
-# if not already done
-suppath=$(echo ${PROJECT}/src | tr -s "/")
-echo ${PATH} | grep -q "${suppath}:"
-test_path=${?}
-if [ ${test_path} -ne 0 ]
+unset maxargcount
+unset narg
+#
+if [ ${pb} -eq 0 ]
 then
-    PATH=${suppath}:${PATH}
-    export PATH
-else
-    # option bavarde oui/non pas encore implantée ++
-    echo "${command} : iii : ${suppath} already in \${PATH}"
+    while [ ${#} -gt 0 ]
+    do
+        case ${1} in
+            -d)
+                # directory for application choosen by user
+                # (see svn checkout command used)
+                directory=${2}
+                shift
+            ;;
+            -i)
+                # directory for inputs choosen by user
+                indir=${2}
+                shift
+            ;;
+            -o)
+                # directory for outputs choosen by user
+                outdir=${2}
+                shift
+            ;;
+            -t)
+                # directory for temporary outputs choosen by user
+                tempdir=${2}
+                shift
+            ;;
+            -s)
+                saxo_dir=${2}
+                shift
+            ;;
+            *)
+                # other choice
+                echo "eee : unknown option ${1}"
+                echo "${usage}"
+                # nb : no exit because this file should be launched
+                # by login process
+            ;;
+        esac
+        # next flag
+        shift
+    done
+    unset usage
 fi
-unset test_path
-#
-# add PROJECT manuals to MANPATH
-# if not already done
-suppath=$(echo ${PROJECT}/doc/man | tr -s "/")
-echo ${MANPATH} | grep -q "${suppath}:"
-test_manpath=${?}
-if [ ${test_manpath} -ne 0 ]
+#
+if [ ${pb} -eq 0 ]
 then
-    MANPATH=${suppath}:${MANPATH}
-    export MANPATH
-else
-    # option bavarde oui/non pas encore implantée ++
-    echo "${command} : iii : ${suppath} already in \${MANPATH}"
+    # check for ${directory}
+    if [ ! -d ${directory} ]
+    then
+        echo " eee : ${directory} not found"
+        # nb : no exit because this file should be launched by login process
+    fi
+    #
+    # check for permission on directory
+    if [ ! -x ${directory} ]
+    then
+        echo " eee : ${directory} not reachable"
+        # nb : no exit because this file should be launched by login process
+    fi
+    #
+    PROJECT=${directory}
+    export PROJECT
+    unset directory
+    #
+    # add PROJECT tools to PATH
+    # if not already done
+    suppath=$(echo ${PROJECT}/src | tr -s "/")
+    echo ${PATH} | grep -q "${suppath}:"
+    test_path=${?}
+    if [ ${test_path} -ne 0 ]
+    then
+        PATH=${suppath}:${PATH}
+        export PATH
+    else
+        # option bavarde oui/non pas encore implantÃ©e ++
+        echo "${command} : iii : ${suppath} already in \${PATH}"
+    fi
+    unset test_path
+    #
+    # add PROJECT manuals to MANPATH
+    # if not already done
+    suppath=$(echo ${PROJECT}/doc/man | tr -s "/")
+    echo ${MANPATH} | grep -q "${suppath}:"
+    test_manpath=${?}
+    if [ ${test_manpath} -ne 0 ]
+    then
+        MANPATH=${suppath}:${MANPATH}
+        export MANPATH
+    else
+        # option bavarde oui/non pas encore implantÃ©e ++
+        echo "${command} : iii : ${suppath} already in \${MANPATH}"
+    fi
+    unset test_manpath
+    unset suppath
+    #
+    PROJECT_LOG=${tempdir}
+    export PROJECT_LOG
+    unset tempdir
+    if [ ! -d ${PROJECT_LOG} ]
+    then
+        mkdir -p ${PROJECT_LOG}
+        status=${?}
+        if [ ${status} -ne 0 ]
+        then
+            echo "${command} : eee : can not create \${POMME_LOG}"
+            # nb : no exit because this file should be launched by login process
+        else
+            echo "${command} : iii : creation of \${PROJECT_LOG}"
+        fi
+        unset status
+    fi
+    # check for permission on PROJECT_LOG
+    if [ ! -x ${PROJECT_LOG} ]
+    then
+        echo " eee : ${PROJECT_LOG} not reachable"
+        # nb : no exit because this file should be launched by login process
+    fi
+    #
+    # check for permission on PROJECT_LOG
+    if [ ! -w ${PROJECT_LOG} ]
+    then
+        echo " eee : ${PROJECT_LOG} not writable"
+        # nb : no exit because this file should reachable be launched
+        # by login process
+    fi
+    #
+    EDITOR=vi
+    export EDITOR
+    #
+    # io directories
+    PROJECT_ID=${indir}
+    export PROJECT_ID
+    unset indir
+    if [ ! -d ${PROJECT_ID} ]
+    then
+        mkdir -p ${PROJECT_ID}
+        echo "${command} : iii : creation of \${PROJECT_ID}"
+    fi
+    # check for permission on PROJECT_ID
+    if [ ! -x ${PROJECT_ID} ]
+    then
+        echo " eee : ${PROJECT_ID} not reachable"
+        # nb : no exit because this file should be launched by login process
+    fi
+    #
+    PROJECT_OD=${outdir}
+    export PROJECT_OD
+    unset outdir
+    if [ ! -d ${PROJECT_OD} ]
+    then
+        mkdir -p ${PROJECT_OD}
+        echo "${command} : iii : creation of \${PROJECT_OD}"
+    fi
+    # check for permission on PROJECT_OD
+    if [ ! -x ${PROJECT_OD} ]
+    then
+        echo " eee : ${PROJECT_OD} not reachable"
+        # nb : no exit because this file should be launched by login process
+    fi
+    if [ ! -w ${PROJECT_OD} ]
+    then
+        echo " eee : ${PROJECT_OD} not writable"
+        # nb : no exit because this file should be launched by login process
+    fi
+    #
+    SAXO_DIR=${saxo_dir}
+    export SAXO_DIR
+    #
+    # IDL startup
+    IDL_STARTUP=${PROJECT}/src/project_init.pro
+    export IDL_STARTUP
 fi
-unset test_manpath
-unset suppath
-#
-PROJECT_LOG=${tempdir}
-export PROJECT_LOG
-unset tempdir
-if [ ! -d ${PROJECT_LOG} ]
-then
-    mkdir -p ${PROJECT_LOG}
-    status=${?}
-    if [ ${status} -ne 0 ]
-    then
-        echo "${command} : eee : can not create \${POMME_LOG}"
-        # nb : no exit because this file should be launched by login process
-    else
-        echo "${command} : iii : creation of \${PROJECT_LOG}"
-    fi
-    unset status
-fi
-# check for permission on PROJECT_LOG
-if [ ! -x ${PROJECT_LOG} ]
-then
-    echo " eee : ${PROJECT_LOG} not reachable"
-    # nb : no exit because this file should be launched by login process
-fi
-#
-# check for permission on PROJECT_LOG
-if [ ! -w ${PROJECT_LOG} ]
-then
-    echo " eee : ${PROJECT_LOG} not writable"
-    # nb : no exit because this file should reachable be launched
-    # by login process
-fi
-#
-EDITOR=vi
-export EDITOR
-#
-# io directories
-PROJECT_ID=${indir}
-export PROJECT_ID
-unset indir
-if [ ! -d ${PROJECT_ID} ]
-then
-    mkdir -p ${PROJECT_ID}
-    echo "${command} : iii : creation of \${PROJECT_ID}"
-fi
-# check for permission on PROJECT_ID
-if [ ! -x ${PROJECT_ID} ]
-then
-    echo " eee : ${PROJECT_ID} not reachable"
-    # nb : no exit because this file should be launched by login process
-fi
-#
-PROJECT_OD=${outdir}
-export PROJECT_OD
-unset outdir
-if [ ! -d ${PROJECT_OD} ]
-then
-    mkdir -p ${PROJECT_OD}
-    echo "${command} : iii : creation of \${PROJECT_OD}"
-fi
-# check for permission on PROJECT_OD
-if [ ! -x ${PROJECT_OD} ]
-then
-    echo " eee : ${PROJECT_OD} not reachable"
-    # nb : no exit because this file should be launched by login process
-fi
-if [ ! -w ${PROJECT_OD} ]
-then
-    echo " eee : ${PROJECT_OD} not writable"
-    # nb : no exit because this file should be launched by login process
-fi
-#
-SAXO_DIR=${saxo_dir}
-export SAXO_DIR
-#
-# IDL startup
-IDL_STARTUP=${PROJECT}/src/project_init.pro
-export IDL_STARTUP
+unset pb
 # end
 unset command
