aboutsummaryrefslogtreecommitdiff
path: root/contrib/get_version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/get_version.sh')
-rwxr-xr-xcontrib/get_version.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/contrib/get_version.sh b/contrib/get_version.sh
index 2a41ed4d6..7366c6bf6 100755
--- a/contrib/get_version.sh
+++ b/contrib/get_version.sh
@@ -15,4 +15,19 @@ if test "x$VERSION" = "x"
15then 15then
16 VERSION="unknown" 16 VERSION="unknown"
17fi 17fi
18echo "$VERSION" 18case $1 in
19"--major")
20 echo "$VERSION" | sed 's/\(^[0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/g'
21 ;;
22"--minor")
23 echo "$VERSION" | sed 's/\(^[0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/g'
24 ;;
25"--micro")
26 echo "$VERSION" | sed 's/\(^[0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/g'
27 ;;
28"--git")
29 echo "$VERSION" | sed 's/\(^[0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\(.*\)/\4/g'
30 ;;
31*)
32 echo "$VERSION"
33esac