[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 15/18] website-build: serve.sh: help: fix program name.
From: |
Denis 'GNUtoo' Carikli |
Subject: |
[PATCH v1 15/18] website-build: serve.sh: help: fix program name. |
Date: |
Sat, 25 May 2024 20:25:50 +0200 |
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/serve.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/website-build/serve.sh b/website-build/serve.sh
index a826c69..8b53545 100755
--- a/website-build/serve.sh
+++ b/website-build/serve.sh
@@ -18,12 +18,14 @@ set -e
usage()
{
- echo "$0 <path/to/tarball> [PORT]"
+ progname="$1"
+
+ echo "${progname} <path/to/tarball> [PORT]"
exit 1
}
if [ $# -ne 1 ] && [ $# -ne 2 ] ; then
- usage
+ usage "serve.sh"
fi
basedir="$(dirname $(realpath $0))"
--
2.41.0
- [PATCH v1 09/18] website-build: build.sh: make it pass shellcheck., (continued)
- [PATCH v1 09/18] website-build: build.sh: make it pass shellcheck., Denis 'GNUtoo' Carikli, 2024/05/25
- [PATCH v1 12/18] website-build: README: fix introduction., Denis 'GNUtoo' Carikli, 2024/05/25
- [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 <=
- [PATCH v1 16/18] website-build: check.sh: help: fix program name., Denis 'GNUtoo' Carikli, 2024/05/25
- [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