New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 8883 for branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/install_new_branch.sh – NEMO

Ignore:
Timestamp:
2017-12-01T18:51:27+01:00 (6 years ago)
Author:
nicolasmartin
Message:

Continuation of global refactoring of Trusting tool: modification of options list to maintain consistency with makenemo
After getting a code snippet on https://stackoverflow.com/questions/402377/using-getopts-in-bash-shell-script-to-get-long-and-short-command-line-options in order to handle short '-[a-z]' and long '[a-z]*=' options, I have modified the main trusting script to split betwwen:

  • Short options reserved shared options with makenemo ( -[hjmnr])
  • Long pattern for trusting specified options
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/install_new_branch.sh

    r8834 r8883  
    1515   '-d'|'--debug'  ) TRUST_FLAG_DEBUG=1 ; shift  ;; '-j'|'--job'    ) TRUST_COMPILE_NPROC=$2; shift 2;; 
    1616   '-m'|'--machine') TRUST_MAIN_HPCC=$2; shift 2;; '-h'|'--help'    ) TRUST_FLAG_HELP=1 ; shift  ;; 
    17    '-u'|'--user'   ) TRUST_MAIN_USER=$2; shift 2;; "*"             ) TRUST_FLAG_HELP=1 ; shift  ;; 
     17   '-u'|'--user'   ) TRUST_MAIN_SETUP=$2; shift 2;; "*"             ) TRUST_FLAG_HELP=1 ; shift  ;; 
    1818    esac 
    1919done 
     
    2222## Initialization (HPC & user environment) 
    2323##--------------------------------------------------- 
    24 if [[ ! -e cfg/${TRUST_MAIN_USER}.cfg || ! -e cfg/${TRUST_MAIN_HPCC}.cfg || ${TRUST_FLAG_HELP} -eq 1 ]]; then 
     24if [[ ! -e cfg/${TRUST_MAIN_SETUP}.cfg || ! -e cfg/${TRUST_MAIN_HPCC}.cfg || ${TRUST_FLAG_HELP} -eq 1 ]]; then 
    2525    cat ./inc/trusting_help.txt 
    2626 
     
    2828   printf "\n\n\033[0;33m" 
    2929   printf "At least one configuration (arch or user) file is missing or misspelled:" 
    30    printf "\t'%s'.cfg\t'%s'.cfg" ${TRUST_MAIN_USER} ${TRUST_MAIN_HPCC} 
     30   printf "\t'%s'.cfg\t'%s'.cfg" ${TRUST_MAIN_SETUP} ${TRUST_MAIN_HPCC} 
    3131   printf "\033[0m" 
    3232    fi 
Note: See TracChangeset for help on using the changeset viewer.