aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-03-25 16:57:29 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-03-25 17:04:55 +0100
commitb325667e48aba3e6d3fd2889533a7cf9a948366a (patch)
tree5dc10f81d04d5ae31ddb9a3272bf37c1ef1ab5be
parentbfe859b89594264b59bdceb3e7cc3b724e68d8f2 (diff)
downloadvendor_replicant-b325667e48aba3e6d3fd2889533a7cf9a948366a.tar.gz
vendor_replicant-b325667e48aba3e6d3fd2889533a7cf9a948366a.tar.bz2
vendor_replicant-b325667e48aba3e6d3fd2889533a7cf9a948366a.zip
build.sh: Add command to print available machines
This makes it easier to reuse that script from other scripts. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rwxr-xr-xbuild.sh24
1 files changed, 17 insertions, 7 deletions
diff --git a/build.sh b/build.sh
index 645e5472..095fb70c 100755
--- a/build.sh
+++ b/build.sh
@@ -30,13 +30,21 @@ supported_machines=" \
usage()
{
- printf "%s <" "$0"
- for machine in ${supported_machines} ; do
- printf "${machine}|"
- done
- printf "\b>\n"
- printf "%s all # build all machines\n" "$0"
- exit 1
+ printf "Usage:\n%s <" "$0"
+ for machine in ${supported_machines} ; do
+ printf "${machine}|"
+ done
+ printf "\b>\n"
+ printf "%s all # build all machines\n" "$0"
+ printf "%s machines # print all machines supported by this script\n" "$0"
+ exit 1
+}
+
+print_machines()
+{
+ for machine in ${supported_machines} ; do
+ printf "${machine}\n"
+ done
}
build()
@@ -62,6 +70,8 @@ if [ "$1" = "all" ] ; then
for machine in ${supported_machines} ; do
build "${machine}"
done
+elif [ "$1" = "machines" ] ; then
+ print_machines
else
found=0
for machine in ${supported_machines} ; do