libreboot-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lbwww-build][ v1 2/4] build.sh: Add help


From: Denis 'GNUtoo' Carikli
Subject: [lbwww-build][ v1 2/4] build.sh: Add help
Date: Wed, 22 Mar 2023 13:09:06 +0100

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
 build.sh | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/build.sh b/build.sh
index dbda770..8b5fbb4 100755
--- a/build.sh
+++ b/build.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
+# Copyright (C) 2022-2023 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,6 +14,26 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
+# For compatibility with sysexits.h (see man 3 sysexits.h for more details)
+EX_USAGE=64
+
+help()
+{
+       echo "Usage: $0 [options]"
+       echo ""
+       echo "Available options:"
+       echo -e "\t-h, --help"
+       echo -e "\t\tDisplay this help and exit."
+}
+
+if [ $# -eq 1 ] && [ "$1" = "-h" -o "$1" == "--help" ] ; then
+       help
+       exit 0
+elif [ $# -ne 0 ] ; then
+       help
+       exit ${EX_USAGE}
+fi
+
 set -e
 
 if [ ! -d untitled ] ; then
-- 
2.39.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]