[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 16/18] website-build: check.sh: help: fix program name.
From: |
Adrien 'neox' Bourmault |
Subject: |
Re: [PATCH v1 16/18] website-build: check.sh: help: fix program name. |
Date: |
Mon, 27 May 2024 15:21:19 +0200 |
User-agent: |
Evolution 3.48.4 |
Le samedi 25 mai 2024 à 20:25 +0200, Denis 'GNUtoo' Carikli a écrit :
> 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>
> ---
> website-build/check.sh | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/website-build/check.sh b/website-build/check.sh
> index 7c1426c..363dd43 100755
> --- a/website-build/check.sh
> +++ b/website-build/check.sh
> @@ -19,9 +19,11 @@ EX_USAGE=64
>
> tarball=""
>
> -help()
> +usage()
> {
> - echo "Usage: $0 [options]"
> + progname="$1"
> +
> + echo "Usage: ${progname} [options]"
> echo ""
> echo "Available options:"
> echo -e "\t-h, --help"
> @@ -76,12 +78,12 @@ run_tests()
> # shellcheck disable=SC2166 # We want to make operator precedence
> # clear.
> if [ $# -eq 1 ] && [ "$1" = "-h" -o "$1" == "--help" ] ; then
> - help
> + usage "check.sh"
> exit 0
> elif [ $# -eq 2 ] && [ "$1" = "-t" -o "$1" = "--tarball" ] ; then
> tarball="$(realpath "$2")"
> run_tests "${tarball}"
> else
> - help
> + usage "check.sh"
> exit ${EX_USAGE}
> fi
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
signature.asc
Description: This is a digitally signed message part
- Re: [PATCH v1 12/18] website-build: README: fix introduction., (continued)
- [PATCH v1 10/18] website-build: targets: rename targets to use build, serve and publish., Denis 'GNUtoo' Carikli, 2024/05/25
- [PATCH v1 13/18] website-build: configure: make realpath and tar requirement work., Denis 'GNUtoo' Carikli, 2024/05/25
- [PATCH v1 14/18] website-build: configure: require awk., Denis 'GNUtoo' Carikli, 2024/05/25
- [PATCH v1 15/18] website-build: serve.sh: help: fix program name., Denis 'GNUtoo' Carikli, 2024/05/25
- [PATCH v1 16/18] website-build: check.sh: help: fix program name., Denis 'GNUtoo' Carikli, 2024/05/25
- Re: [PATCH v1 16/18] website-build: check.sh: help: fix program name.,
Adrien 'neox' Bourmault <=
- [PATCH v1 18/18] website-build: check.sh: start adding tests for site/., Denis 'GNUtoo' Carikli, 2024/05/25
- [PATCH v1 17/18] website-build: serve.sh: remove the need for random temporary directory., Denis 'GNUtoo' Carikli, 2024/05/25