From 2c46f0da0c65c5437bb8c957b4a2952916e0f869 Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Sun, 31 Oct 2021 22:31:47 +0100 Subject: [PATCH] restore arg help --- cmd/restore.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/restore.go b/cmd/restore.go index 8237199..f22a1dd 100644 --- a/cmd/restore.go +++ b/cmd/restore.go @@ -9,8 +9,9 @@ import ( ) var restoreCmd = &cobra.Command{ - Use: "restore", + Use: "restore [snapshot id]", Short: "Restore backup for location", + Args: cobra.MaximumNArgs(1), Run: func(cmd *cobra.Command, args []string) { err := lock.Lock() CheckErr(err) @@ -24,7 +25,11 @@ var restoreCmd = &cobra.Command{ target, _ := cmd.Flags().GetString("to") from, _ := cmd.Flags().GetString("from") force, _ := cmd.Flags().GetBool("force") - err = l.Restore(target, from, force) + snapshot := "" + if len(args) > 0 { + snapshot = args[0] + } + err = l.Restore(target, from, force, snapshot) CheckErr(err) }, }