add -V
This commit is contained in:
parent
54154f5360
commit
1b51381cc4
|
@ -68,6 +68,8 @@ Usage
|
||||||
-n dry-run, don't actually create snapshots
|
-n dry-run, don't actually create snapshots
|
||||||
-x don't automatically append the date in epoch to
|
-x don't automatically append the date in epoch to
|
||||||
the snapshot name
|
the snapshot name
|
||||||
|
-V print the version number and exit
|
||||||
|
|
||||||
Development Notes
|
Development Notes
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
# Date: November 20, 2015
|
# Date: November 20, 2015
|
||||||
# License: MIT
|
# License: MIT
|
||||||
|
|
||||||
|
VERSION='v1.0.0'
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
local prog=${0##*/}
|
local prog=${0##*/}
|
||||||
cat <<-EOF
|
cat <<-EOF
|
||||||
|
@ -29,16 +31,18 @@ usage() {
|
||||||
-n dry-run, don't actually create snapshots
|
-n dry-run, don't actually create snapshots
|
||||||
-x don't automatically append the date in epoch to
|
-x don't automatically append the date in epoch to
|
||||||
the snapshot name
|
the snapshot name
|
||||||
|
-V print the version number and exit
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
dryrun=false
|
dryrun=false
|
||||||
date=true
|
date=true
|
||||||
while getopts 'hnx' option; do
|
while getopts 'hnxV' option; do
|
||||||
case "$option" in
|
case "$option" in
|
||||||
h) usage; exit 0;;
|
h) usage; exit 0;;
|
||||||
n) dryrun=true;;
|
n) dryrun=true;;
|
||||||
x) date=false;;
|
x) date=false;;
|
||||||
|
V) echo "$VERSION"; exit 0;;
|
||||||
*) usage; exit 1;;
|
*) usage; exit 1;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue