website-build: check.sh: help: fix program name.

The GNU Coding Standards has the following in the chapter "4.8.1
--version"[1]:
    The program’s name should be a constant string; don’t compute it
    from argv[0]. The idea is to state the standard or canonical name
    for the program, not its file name. There are other ways to find
    out the precise file name where a command is found in PATH.
[1]https://www.gnu.org/prep/standards/standards.html#g_t_002d_002dversion

This fixes that.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2024-05-20 15:07:59 +02:00
parent fc8aa115a0
commit 14167862d7
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
1 changed files with 6 additions and 4 deletions

View File

@ -19,9 +19,11 @@ EX_USAGE=64
tarball="" tarball=""
help() usage()
{ {
echo "Usage: $0 [options]" progname="$1"
echo "Usage: ${progname} [options]"
echo "" echo ""
echo "Available options:" echo "Available options:"
echo -e "\t-h, --help" echo -e "\t-h, --help"
@ -76,12 +78,12 @@ run_tests()
# shellcheck disable=SC2166 # We want to make operator precedence # shellcheck disable=SC2166 # We want to make operator precedence
# clear. # clear.
if [ $# -eq 1 ] && [ "$1" = "-h" -o "$1" == "--help" ] ; then if [ $# -eq 1 ] && [ "$1" = "-h" -o "$1" == "--help" ] ; then
help usage "check.sh"
exit 0 exit 0
elif [ $# -eq 2 ] && [ "$1" = "-t" -o "$1" = "--tarball" ] ; then elif [ $# -eq 2 ] && [ "$1" = "-t" -o "$1" = "--tarball" ] ; then
tarball="$(realpath "$2")" tarball="$(realpath "$2")"
run_tests "${tarball}" run_tests "${tarball}"
else else
help usage "check.sh"
exit ${EX_USAGE} exit ${EX_USAGE}
fi fi