Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 6f60b639 authored by Kostis ANAGNOSTOPOULOS's avatar Kostis ANAGNOSTOPOULOS Committed by inp
Browse files

feat(setup) exec many actions in cmdline; >

* feat: provide help-msg if --help/-h given anywhere in args.
* refact: simplify help-msg formatting in one cmd.
parent fd8279ce
No related branches found
No related tags found
No related merge requests found
...@@ -279,20 +279,31 @@ function all { ...@@ -279,20 +279,31 @@ function all {
done done
} }
if [[ $# -eq 1 && ( "$1" = "-h" || "$1" = "--help" ) ]]; then ## Trick to search if NOT help- asked
echo -e "$mycmd - actions to setup a BDAP user account.\n" # from: https://superuser.com/a/1002826/227922
echo -e "SYNTAX:\n $mycmd\n $mycmd ACTION\nWHERE:\n ACTION is one of:" if [[ "${@#-h}" = "$@" && "${@#--help}" = "$@" ]]; then
_list_all_actions if [[ $# -eq 0 ]]; then
echo -e '\nWithout any args, it launches `all` actions, in order.'
echo -e '\nNOTES:\n * The `upd30_git_user` action awaits interactively input from the user.'
echo -e ' * You may have to logout & re-login after `upd40_bashrc_conda_init`,
for `upd50_create_conda_env` to succeed.'
echo -e ' * You can repeatedly run this script, until all action succeed.'
elif [[ $# -eq 0 ]]; then
echo "Running all actions..." echo "Running all actions..."
all all
else else
echo "Running x$# actions: '${@}'"
## execute the asked action. ## execute the asked action.
echo "Running '${@}' action..." for cmd in "${@}"; do
"${@}" $cmd
done
fi
else
echo "$mycmd - actions to setup a BDAP user account.
SYNTAX:
$mycmd [ACTION]...
WHERE:
ACTION is one of:
$(_list_all_actions)
NOTES:
* Without any args, it launches 'all' actions above, in that order.
* The 'upd30_git_user_XXX' actions awaits interactively input from the user.
* You may have to logout & re-login after 'upd40_bashrc_conda_init',
for 'upd50_create_conda_env' to succeed.
* You can repeatedly run this script, until all actions succeed.
"
fi fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment