libreboot-devel
[Top][All Lists]
Advanced

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

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


From: Adrien Bourmault
Subject: Re: [lbwww-build][ v1 2/4] build.sh: Add help
Date: Wed, 22 Mar 2023 14:36:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2

Acked-by: Adrien 'neox' Bourmault <neox@a-lec.org>

Le 22/03/2023 à 13:09, Denis 'GNUtoo' Carikli a écrit :
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

Attachment: OpenPGP_0xAAD6B069819E6979.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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