Skip to content
Snippets Groups Projects
Commit b8432d98 authored by Aurélien Olivier's avatar Aurélien Olivier
Browse files

New option "--version"

At build time, we use the version number provided by configure.ac, which
is updated upstream when there is a new release.
parent 623b777a
No related branches found
No related tags found
1 merge request!18New option "--version"
...@@ -21,7 +21,7 @@ BACKUPNINJA \- A lightweight, extensible meta-backup system ...@@ -21,7 +21,7 @@ BACKUPNINJA \- A lightweight, extensible meta-backup system
.I .I
"a silent flower blossom death strike to lost data." "a silent flower blossom death strike to lost data."
.SH SYNOPSIS .SH SYNOPSIS
.B "backupninja [ \-h ] [ \-d ] [ \-n ] [ \-t ] [ \-f filename ] [ \-\-run filename ]" .B "backupninja [ \-h ] [ \-v ] [ \-d ] [ \-n ] [ \-t ] [ \-f filename ] [ \-\-run filename ]"
.br .br
.SH DESCRIPTION .SH DESCRIPTION
.B Backupninja .B Backupninja
...@@ -71,6 +71,9 @@ burn CD/DVDs or create ISOs. ...@@ -71,6 +71,9 @@ burn CD/DVDs or create ISOs.
.B \-h, \-\-help .B \-h, \-\-help
Show summary of options Show summary of options
.TP .TP
.B \-v, \-\-version
Show backupninja version number
.TP
.B \-d, \-\-debug .B \-d, \-\-debug
Run in debug mode, where all log messages are output to the current shell. Run in debug mode, where all log messages are output to the current shell.
.TP .TP
......
...@@ -15,7 +15,8 @@ edit = sed \ ...@@ -15,7 +15,8 @@ edit = sed \
-e 's,@datadir\@,$(pkgdatadir),g' \ -e 's,@datadir\@,$(pkgdatadir),g' \
-e "s,@libdir\@,$(pkglibdir),g" \ -e "s,@libdir\@,$(pkglibdir),g" \
-e 's,@localstatedir\@,$(localstatedir),g' \ -e 's,@localstatedir\@,$(localstatedir),g' \
-e 's,@prefix\@,$(prefix),g' -e 's,@prefix\@,$(prefix),g' \
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g'
#install-exec-hook: #install-exec-hook:
......
...@@ -278,6 +278,7 @@ script is run hourly from cron. ...@@ -278,6 +278,7 @@ script is run hourly from cron.
The following options are available: The following options are available:
-h, --help This usage message -h, --help This usage message
-v, --version Show backupninja version number
-d, --debug Run in debug mode, where all log messages are -d, --debug Run in debug mode, where all log messages are
output to the current shell. output to the current shell.
-f, --conffile FILE Use FILE for the main configuration instead -f, --conffile FILE Use FILE for the main configuration instead
...@@ -431,12 +432,14 @@ function process_action() { ...@@ -431,12 +432,14 @@ function process_action() {
setupcolors setupcolors
conffile="@CFGDIR@/backupninja.conf" conffile="@CFGDIR@/backupninja.conf"
loglevel=3 loglevel=3
version="@PACKAGE_VERSION@"
## process command line options ## process command line options
while [ $# -ge 1 ]; do while [ $# -ge 1 ]; do
case $1 in case $1 in
-h|--help) usage;; -h|--help) usage;;
-v|--version) echo "backupninja $version";;
-d|--debug) debug=1; export BACKUPNINJA_DEBUG=yes;; -d|--debug) debug=1; export BACKUPNINJA_DEBUG=yes;;
-t|--test) test=1;debug=1;; -t|--test) test=1;debug=1;;
-n|--now) processnow=1;; -n|--now) processnow=1;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment