From 1b51381cc44928b1aac70c58059792270a3e1ae5 Mon Sep 17 00:00:00 2001 From: Dave Eddy Date: Mon, 12 Nov 2018 13:44:14 -0500 Subject: [PATCH] add -V --- README.md | 2 ++ zfs-snapshot-all | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c0409c7..2f20a9d 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,8 @@ Usage -n dry-run, don't actually create snapshots -x don't automatically append the date in epoch to the snapshot name + -V print the version number and exit + Development Notes ----------------- diff --git a/zfs-snapshot-all b/zfs-snapshot-all index 9f506c0..8394044 100755 --- a/zfs-snapshot-all +++ b/zfs-snapshot-all @@ -6,6 +6,8 @@ # Date: November 20, 2015 # License: MIT +VERSION='v1.0.0' + usage() { local prog=${0##*/} cat <<-EOF @@ -29,16 +31,18 @@ usage() { -n dry-run, don't actually create snapshots -x don't automatically append the date in epoch to the snapshot name + -V print the version number and exit EOF } dryrun=false date=true -while getopts 'hnx' option; do +while getopts 'hnxV' option; do case "$option" in h) usage; exit 0;; n) dryrun=true;; x) date=false;; + V) echo "$VERSION"; exit 0;; *) usage; exit 1;; esac done