Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for --help and -h with the setup scripts #590

Merged
merged 2 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading