From 7cf9e09fcc62813810704e13c54faf82ce484bfb Mon Sep 17 00:00:00 2001 From: Kyle Buller Date: Mon, 5 Apr 2021 00:36:53 -0500 Subject: [PATCH] Show tokens with -n help --- README.md | 2 +- release.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b9522a6..e8c487f 100644 --- a/README.md +++ b/README.md @@ -253,7 +253,7 @@ The recommended way to include __release.sh__ in a project is to: -a wago-id Set the project id used on Wago Addons for uploading. (Use 0 to unset the TOC value) -g game-version Set the game version to use for uploading. -m pkgmeta.yaml Set the pkgmeta file to use. - -n archive-name Set the archive name template. Defaults to "{package-name}-{project-version}{nolib}{classic}". + -n archive-name Set the archive name template. Use "-n help" for more info. ### Uploading diff --git a/release.sh b/release.sh index f53552b..0c5f3da 100755 --- a/release.sh +++ b/release.sh @@ -232,6 +232,24 @@ while getopts ":celLzusop:dw:a:r:t:g:m:n:" opt; do pkgmeta_file="$OPTARG" ;; n) + if [ "$OPTARG" = "help" ]; then + cat <<-'EOF' >&2 + Set the archive name template. There are several string substitutions you can use to + include version control or build type infomation in the file name. + + The default file name is "{package-name}-{project-version}{nolib}{classic}". + + Tokens: {package-name}{project-revision}{project-hash}{project-abbreviated-hash} + {project-author}{project-date-iso}{project-date-integer}{project-timestamp} + {project-version}{game-type}{release-type} + + Flags: {alpha}{beta}{nolib}{classic} + + Tokens are always replaced with their value. Flags are shown prefixed with a dash + depending on the build type. + EOF + exit 0 + fi # TODO some sort of validation? file_name="$OPTARG" ;;