Add version information
This commit is contained in:
parent
fd6a50a36b
commit
95b4b66a99
1 changed files with 17 additions and 3 deletions
20
ccollect.sh
20
ccollect.sh
|
@ -14,8 +14,8 @@ CPREEXEC="${CDEFAULTS}/pre_exec"
|
||||||
CPOSTEXEC="${CDEFAULTS}/post_exec"
|
CPOSTEXEC="${CDEFAULTS}/post_exec"
|
||||||
|
|
||||||
TMP=$(mktemp "/tmp/$(basename $0).XXXXXX")
|
TMP=$(mktemp "/tmp/$(basename $0).XXXXXX")
|
||||||
VERSION=0.6
|
VERSION=0.6.1
|
||||||
RELEASE="2007-08-17"
|
RELEASE="2007-08-XX"
|
||||||
HALF_VERSION="ccollect ${VERSION}"
|
HALF_VERSION="ccollect ${VERSION}"
|
||||||
FULL_VERSION="ccollect ${VERSION} (${RELEASE})"
|
FULL_VERSION="ccollect ${VERSION} (${RELEASE})"
|
||||||
|
|
||||||
|
@ -59,6 +59,15 @@ add_name()
|
||||||
sed "s:^:\[${name}\] :"
|
sed "s:^:\[${name}\] :"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Version
|
||||||
|
#
|
||||||
|
display_version()
|
||||||
|
{
|
||||||
|
echo "${FULL_VERSION}"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Tell how to use us
|
# Tell how to use us
|
||||||
#
|
#
|
||||||
|
@ -72,6 +81,7 @@ usage()
|
||||||
echo " -p, --parallel: Parallelise backup processes"
|
echo " -p, --parallel: Parallelise backup processes"
|
||||||
echo " -a, --all: Backup all sources specified in ${CSOURCES}"
|
echo " -a, --all: Backup all sources specified in ${CSOURCES}"
|
||||||
echo " -v, --verbose: Be very verbose (uses set -x)"
|
echo " -v, --verbose: Be very verbose (uses set -x)"
|
||||||
|
echo " -V, --version: Print version information"
|
||||||
echo ""
|
echo ""
|
||||||
echo " This is version ${VERSION}, released on ${RELEASE}"
|
echo " This is version ${VERSION}, released on ${RELEASE}"
|
||||||
echo " (the first version was written on 2005-12-05 by Nico Schottelius)."
|
echo " (the first version was written on 2005-12-05 by Nico Schottelius)."
|
||||||
|
@ -84,7 +94,11 @@ usage()
|
||||||
# need at least interval and one source or --all
|
# need at least interval and one source or --all
|
||||||
#
|
#
|
||||||
if [ $# -lt 2 ]; then
|
if [ $# -lt 2 ]; then
|
||||||
usage
|
if [ "$1" = "-V" -o "$1" = "--version" ]; then
|
||||||
|
display_version
|
||||||
|
else
|
||||||
|
usage
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue