diff options
Diffstat (limited to 'contrib/get_version.sh')
-rwxr-xr-x | contrib/get_version.sh | 17 |
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" | |||
15 | then | 15 | then |
16 | VERSION="unknown" | 16 | VERSION="unknown" |
17 | fi | 17 | fi |
18 | echo "$VERSION" | 18 | case $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" | ||
33 | esac | ||