Snapshot descriptions implenented
Snapshots descriptions for snapshot listing implemented
This commit is contained in:
parent
5701784128
commit
c5e4056ba0
11
snapsh
11
snapsh
|
@ -34,6 +34,10 @@ help() {
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-h, --help Display this help message
|
-h, --help Display this help message
|
||||||
|
-d STR, --description STR Add a description for the snapshot displayed in the
|
||||||
|
snapshots listing. Must be used before -s, e.g.
|
||||||
|
snapsh -d "A snapshot" -s root
|
||||||
|
-s SUBVOL, --snapshot SUBVOL Take a snapshot of subvolume named SUBVOL.
|
||||||
|
|
||||||
Exit codes:
|
Exit codes:
|
||||||
2 - Invalid options
|
2 - Invalid options
|
||||||
|
@ -106,7 +110,7 @@ fi
|
||||||
|
|
||||||
|
|
||||||
# Options parsing:
|
# Options parsing:
|
||||||
OPTIONS=$(getopt -a -n snapsh -o hs: --long help,snapshot: -- "$@")
|
OPTIONS=$(getopt -a -n snapsh -o hs:d: --long help,snapshot:,description: -- "$@")
|
||||||
|
|
||||||
# Invalid options (getopt returns nonzero)
|
# Invalid options (getopt returns nonzero)
|
||||||
if [[ "$?" -ne 0 ]]; then
|
if [[ "$?" -ne 0 ]]; then
|
||||||
|
@ -125,6 +129,11 @@ while true; do
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
-d | --description)
|
||||||
|
DESCRIPTION="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
|
||||||
-s | --snapshot)
|
-s | --snapshot)
|
||||||
SUBVOLUME="$2"
|
SUBVOLUME="$2"
|
||||||
snapshot
|
snapshot
|
||||||
|
|
Loading…
Reference in New Issue