summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-11-08 06:17:40 +0000
committerLeah Rowe <leah@libreboot.org>2023-11-08 06:21:25 +0000
commit64f933747021cb783230b9aef367921884ece555 (patch)
treecc7ec70cb988cc010c8e1aa9994bbdec2a7dd4e8
parentf4b2a588e27f1bc8d13ed1f31c68590bd76dcf4f (diff)
lbmk: support showing the revision in help text
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rwxr-xr-xbuild22
1 files changed, 20 insertions, 2 deletions
diff --git a/build b/build
index 0d9fcf46..6e61c763 100755
--- a/build
+++ b/build
@@ -65,8 +65,15 @@ initialise_command()
check_project
case "${1}" in
- help) usage ${0} && lbmk_exit 0 ;;
- list) items "${buildpath}" && lbmk_exit 0 ;;
+ help)
+ usage ${0}
+ lbmk_exit 0 ;;
+ list)
+ items "${buildpath}"
+ lbmk_exit 0 ;;
+ version)
+ mkversion
+ lbmk_exit 0 ;;
esac
option="${1}"
}
@@ -116,15 +123,26 @@ usage()
{
progname=${0}
cat <<- EOF
+ $(mkversion)
+
USAGE: ${progname} <OPTION>
possible values for 'OPTION':
$(items "${buildpath}")
+ To know whot ${projectname} version you're on, type:
+ ${progname} version
+
Refer to ${projectname} documentation for more info.
EOF
}
+mkversion()
+{
+ printf "revision: %s %s\n" "${projectname}" "${version}"
+ printf "revision date: %s\n" "$(date -Rud @${versiondate})"
+}
+
lbmk_exit()
{
tmp_cleanup || err "lbmk_exit: can't rm tmpdir upon exit $1: ${tmpdir}"