Commit ba65a553 authored by PENGUEN Julien's avatar PENGUEN Julien
Browse files

ajout options '--survey' et '--area' pour donner en ligne de commande les...

ajout options '--survey' et '--area' pour donner en ligne de commande les fichiers surveys.dat et areas.csv
parent bf023962
......@@ -206,6 +206,38 @@ function_sort_tab()
}
function_return_indice_arg()
{
# function_return_indice_arg: get the indice in input array of the element we want
# input:
# -tab: array of options present on $@
# -find_arg: option we want find
# return:
# -indice of the option we want find
#---------------#
#input arguments
tab=$1
find_arg=$2
#---------------#
tempo_tab=( ${tab// / } )
val="None"
#------------------------------------#
#loop to find indice of option we want
for k in ${!tempo_tab[*]}
do
if [ "${tempo_tab[$k]}" == "$find_arg" ]; then
val=$k
fi
done
#------------------------------------#
echo $val
}
function_jar_updated_search()
{
# function_jar_updated_search: get the last jar version
......@@ -382,7 +414,6 @@ done
# call function_sort_tab
RESULTAT=`function_build_tab_hach $@`
#function_build_tab_hach $@
tab_arg_keys=`echo $RESULTAT | cut --delimiter=, -f 1`
tab_arg_values=`echo $RESULTAT | cut --delimiter=, -f 2`
......@@ -493,6 +524,19 @@ case $taille in
fi
elif [ "${tempo_arg_weight[0]}" -eq 2 ]; then
tab2_arg_keys[0]="--no_select"
tab2_arg_values[0]="$ALADIN_VERSION"
tab2_arg_weight[0]=0
tab2_arg_keys[1]=${tab_arg_keys}
tab2_arg_values[1]=${tab_arg_values}
tab2_arg_weight[1]=${tab_arg_weight}
arg_keys=( ${tab2_arg_keys[@]// / } )
arg_values=( ${tab2_arg_values[@]// / } )
arg_weight=( ${tab2_arg_weight[@]// / } )
else
echo '=> No case possible for the moment'
......@@ -551,6 +595,23 @@ case $taille in
fi
fi
if [ "$tempo_weight_2" == 'TRUE' ]; then
#case '--survey', '--area'
tab2_arg_keys[0]="--no_select"
tab2_arg_values[0]="$ALADIN_VERSION"
tab2_arg_weight[0]=0
tab2_arg_keys[1]=${tab_arg_keys}
tab2_arg_values[1]=${tab_arg_values}
tab2_arg_weight[1]=${tab_arg_weight}
arg_keys=( ${tab2_arg_keys[@]// / } )
arg_values=( ${tab2_arg_values[@]// / } )
arg_weight=( ${tab2_arg_weight[@]// / } )
fi
;;
......@@ -571,6 +632,23 @@ sort_arg_keys=( ${tab_sort_arg_keys// / } )
sort_arg_values=( ${tab_sort_arg_values// / } )
sort_arg_weight=( ${tab_sort_arg_weight// / } )
#------------------------------#
#check survey or area input args
if [[ "${sort_arg_keys[@]}" =~ "--survey" ]]; then
RESULT_INDICE_SURVEY=`function_return_indice_arg "${sort_arg_keys[*]}" "--survey"`
INPUT_FILE_SURVEYS=${sort_arg_values[$RESULT_INDICE_SURVEY]}
fi
if [[ "${sort_arg_keys[@]}" =~ "--area" ]]; then
RESULT_INDICE_AREA=`function_return_indice_arg "${sort_arg_keys[*]}" "--area"`
INPUT_FILE_AREAS=${sort_arg_values[$RESULT_INDICE_AREA]}
fi
echo "=> use ${INPUT_FILE_SURVEYS}"
echo "=> use ${INPUT_FILE_AREAS}"
#---------------------#
# --no_select management
......@@ -582,14 +660,23 @@ sort_arg_weight=( ${tab_sort_arg_weight// / } )
#---------------------#
for k in ${!sort_arg_weight[*]}
do
echo "sort_arg_keys[$k]=${sort_arg_keys[$k]}"
echo "sort_arg_values[$k]=${sort_arg_values[$k]}"
echo "sort_arg_weight[$k]=${sort_arg_weight[$k]}"
done
case ${sort_arg_keys[0]} in
#case $1 in
#case $@ in
# ""|"--select"|"--force-all"|"--force")
""|"--select")
###################################
# use: ./photos_montage_aladin.sh #
###################################
####################################################
# use: ./photos_montage_aladin.sh #
# or #
# use: ./photos_montage_aladin.sh --select version #
####################################################
version_init=$(cat .env | grep ALADIN_VERSION)
......@@ -730,6 +817,7 @@ case ${sort_arg_keys[0]} in
fi
#------------------------#
#------------------------#
indice=0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment