From: Kai Moritz Date: Sun, 3 May 2026 08:08:39 +0000 (+0200) Subject: Refined usage-description in `import-in-hugo.sh` X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=1b6ef1de968016c56add45bf0054f9fb1c9f7905;p=maven-thymeleaf-skin Refined usage-description in `import-in-hugo.sh` --- diff --git a/src/main/resources/import-in-hugo.sh b/src/main/resources/import-in-hugo.sh index 80c14a2..77caf78 100644 --- a/src/main/resources/import-in-hugo.sh +++ b/src/main/resources/import-in-hugo.sh @@ -1,20 +1,30 @@ #!/usr/bin/env bash set -euo pipefail +USAGE=$( + echo "Usage: $0 [--base ] [--separator ] [ [ --current []] | [--archived []] ]"; + cat << EOF + +--base : Specifies the base-path for the rendered site. + If not specifed, the site is rendered as a root section. + The artifact-id and the version are always added to the + path. +--current : [DEFAULT] + Adds "url: //" to front-matter. + If "" is not specified, "//" + is used. + Only one of "--current" and "--archived" can be used! +--archived : Adds "params.canonical=//" to + front-matter. + If "" is not specified, "//" + is used. + Only one of "--current" and "--archived" can be used! +EOF +) + if [ $# -lt 1 ] then - echo "Usage: $0 [--base ] [ [ --current []] | [--archived []] ]" - echo - echo "--base : Specifies the base-path for the rendered site." - echo " If not specifed, the site is rendered as a root section." - echo " The artifact-id and the version are always added to the path." - echo "--current : [DEFAULT]" - echo " Adds "url: //" to front-matter." - echo " If "" is not specified, "//" is used." - echo " Only one of "--current" and "--archived" can be used!" - echo "--archived : Adds "params.canonical=//" to front-matter." - echo " If "" is not specified, "//" is used." - echo " Only one of "--current" and "--archived" can be used!" + echo "$USAGE" exit 1 fi @@ -74,7 +84,9 @@ while [[ $# -gt 0 ]]; do fi ;; *) - echo "Unknown parameter: $1" + echo "ERROR -- Unknown parameter: $1" + echo + echo "$USAGE" exit 1 ;; esac @@ -83,6 +95,8 @@ done if [[ "$CURRENT" -eq 1 && "$ARCHIVED" -eq 1 ]] then echo "ERROR -- Only one of "--current" and "--archived" can be specified!" + echo + echo "$USAGE" exit 1 fi if [[ "$CURRENT" -eq 0 && "$ARCHIVED" -eq 0 ]]