build.sh: Add help

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@a-lec.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2023-03-22 02:05:19 +01:00
parent 6ba4e7cf7d
commit 84bb0a3076
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
1 changed files with 21 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/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 # 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 # 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 # You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>. # 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 set -e
if [ ! -d untitled ] ; then if [ ! -d untitled ] ; then