Skip to content

Commit

Permalink
Add support for --help and -h with the setup scripts (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell authored Jun 2, 2024
1 parent 2b48e62 commit ede3322
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion scripts/cvmfs/setup-nightlies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
function usage() {
echo "Usage: source /cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh [-r <release>] [--list-releases [distribution]] [--list-packages [distribution]]"
echo " -r <release> : setup a specific release, if not specified the latest release will be used (also used for --list-packages)"
echo " -h : print this help message"
echo " --help, -h : print this help message"
echo " --list-releases [distribution] : list available releases for the specified distribution (almalinux, centos, ubuntu). By default (no OS is specified) it will list the releases for the detected distribution"
echo " --list-packages [distribution] : list available packages and their versions for the specified distribution (almalinux, centos, ubuntu). By default (no OS is specified) it will list the packages for the detected distribution"
echo "In addition, after sourcing, the command k4_local_repo can be used to add the current repository to the environment"
echo "It will delete all the existing paths containing the repository name and add some predefined paths to the environment"
}

function check_release() {
Expand Down Expand Up @@ -88,6 +90,10 @@ for ((i=1; i<=$#; i++)); do
eval arg=\$$i
eval "argn=\${$((i+1))}"
case $arg in
--help|-h)
usage
return 0
;;
--list-releases)
if [ ! -n "$argn" ]; then
list_release $os
Expand Down
10 changes: 8 additions & 2 deletions scripts/cvmfs/setup-releases.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/bin/bash

# This script sets up the Key4hep software stack from CVMFS for the nightlies
# This script sets up the Key4hep software stack from CVMFS for the stable releases

function usage() {
echo "Usage: source /cvmfs/sw.hsf.org/key4hep/setup.sh [-r <release>] [--list-releases [distribution]] [--list-packages [distribution]]"
echo " -r <release> : setup a specific release, if not specified the latest release will be used (also used for --list-packages)"
echo " -h : print this help message"
echo " --help, -h : print this help message"
echo " --list-releases [distribution] : list available releases for the specified distribution (almalinux, centos, ubuntu). By default (no OS is specified) it will list the releases for the detected distribution"
echo " --list-packages [distribution] : list available packages and their versions for the specified distribution (almalinux, centos, ubuntu). By default (no OS is specified) it will list the packages for the detected distribution"
echo "In addition, after sourcing, the command k4_local_repo can be used to add the current repository to the environment"
echo "It will delete all the existing paths containing the repository name and add some predefined paths to the environment"
}

function check_release() {
Expand Down Expand Up @@ -99,6 +101,10 @@ for ((i=1; i<=$#; i++)); do
eval arg=\$$i
eval "argn=\${$((i+1))}"
case $arg in
--help|-h)
usage
return 0
;;
--list-releases)
if [ ! -n "$argn" ]; then
list_release $os
Expand Down

0 comments on commit ede3322

Please sign in to comment.