Test commit
[cogito/jonas.git] / cg-version.in
blobb4d5eb29e671929f4e85fd2c14e5ff6bad6e7a8e
1 #!/usr/bin/env bash
3 # Show the version of the Cogito toolkit
4 # Copyright (c) Petr Baudis, 2005
6 # Show which version of Cogito is installed.
7 # Additionally, the 'HEAD' of the installed Cogito
8 # is also shown if this information was available
9 # at the build time.
11 # OPTIONS
12 # -------
13 # --lib-dir:: Display Cogito library directory
14 # Display the directory containing Cogito library files.
16 # --share-dir:: Display Cogito share directory
17 # Display the directory containing Cogito shared files.
19 # Testsuite: TODO
21 USAGE="cg-version [--lib-dir] [--share-dir]"
22 _git_repo_unneeded=1
24 . "${COGITO_LIB}"cg-Xlib || exit 1
26 while optparse; do
27 if optparse --lib-dir; then
28 echo "${COGITO_LIB}"
29 elif optparse --share-dir; then
30 echo "${COGITO_SHARE}"
31 else
32 optfail
34 done
36 version="@@VERSION@@"
37 head="@@GIT_HEAD_ID@@"
38 if [ -z "$head" ]; then
39 echo "$version"
40 exit
41 elif [ "$version" = "$head" ]; then
42 echo "$version (real)"
43 else
44 echo "$version ($head)"