Skip to content

Commit 0dbabea

Browse files
Added better help messages
1 parent 646d3ae commit 0dbabea

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

toolchain/bootstrap/format.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
#!/bin/bash
22

3+
# Function to display help message
4+
show_help() {
5+
echo "Usage: $(basename "$0") [OPTIONS]"
6+
echo "This function formats all code in and below the current execution directory."
7+
echo ""
8+
echo "Options:"
9+
echo " -h, --help Display this help message and exit."
10+
echo " -j, --jobs JOBS Runs JOBS number of jobs."
11+
echo ""
12+
exit 0
13+
}
14+
315
while [[ $# -gt 0 ]]; do
416
case "$1" in
517
-j|--jobs)
618
JOBS="$2"
719
shift
820
;;
21+
-h | --help)
22+
show_help
23+
;;
924
*)
1025
echo "Format, unknown argument: $1."
1126
exit 1

toolchain/bootstrap/modules.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
#!/bin/bash
22

3+
# Function to display help message
4+
show_help() {
5+
echo "Usage: $(basename "$0") [OPTIONS]"
6+
echo "This function loads in modules for a specific computer and mode"
7+
echo ""
8+
echo "Options:"
9+
echo " -h, --help Display this help message and exit."
10+
echo " -c, --computer COMPUTER Configures for COMPUTER environment."
11+
echo " Options: Ascent (a) | Frontier (f) | Summit (s) | Wombat (w)"
12+
echo " Bridges2 (b) | Expanse (e) | Delta (d) | DeltaAI (dai)"
13+
echo " Phoenix (p) | Richardson (r) | Oscar (o)"
14+
echo " Carpenter Cray (cc) | Carpenter GNU (c) | Nautilus (n)"
15+
echo " -m, --mode MODE Configures into MODE."
16+
echo " Options: gpu (g) | cpu (c)"
17+
echo ""
18+
exit 0
19+
}
20+
321
unset u_c
422
unset u_cg
523

@@ -12,6 +30,7 @@ while [[ $# -gt 0 ]]; do
1230
case $1 in
1331
-c|--computer) u_c="$2"; shift; shift; ;;
1432
-m|--mode) u_cg="$2"; shift; shift; ;;
33+
-h|--help) show_help; shift; shift; ;;
1534
-*|--*) echo "Unknown option $1"; return; ;;
1635
esac
1736
done

0 commit comments

Comments
 (0)