summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/opkbuild.sh19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/opkbuild.sh b/src/opkbuild.sh
index 7d5f963..25bb041 100644
--- a/src/opkbuild.sh
+++ b/src/opkbuild.sh
@@ -28,6 +28,19 @@ print_usage()
printf 'Usage: %s [-r assume-uid0-cmd] [-p target-platform] [-d]\n' "${1}"
}
+print_version()
+{
+ cat <<EOF
+opkbuild (@@PACKAGE@@) @@VERSION@@
+Copyright (C) 2012 Patrick "P. J." McDermott
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+Written by P. J. McDermott.
+EOF
+}
+
error()
{
[ ${#} -eq 1 ] && printf 'opkbuild: [%s] Error\n' "${1}" >&2
@@ -40,7 +53,7 @@ error()
exit 1
}
-opts=$(getopt -n "${0}" -o 'r:p:ds:' -- "${@}")
+opts=$(getopt -n "${0}" -o 'r:p:ds:V' -- "${@}")
if [ ${?} -ne 0 ]; then
print_usage "${0}" >&2
exit 1;
@@ -64,6 +77,10 @@ while true; do
status_override=${2}
shift 2
;;
+ -V)
+ print_version
+ exit 0
+ ;;
--)
shift
break