feat: Add the vantagectl restore and verify subcommands

--force requires a typed database name on a terminal and --confirm-db
without one, so a copy-pasted restore command carries its intended target
and cannot destroy a different database.

Also silences cobra's own error print (root.go) so a failure is reported
once by main.go instead of twice, and pins the Changed()-based env
fallback in resolveGlobals with a test for an explicitly empty --db.
This commit is contained in:
2026-09-07 14:04:25 +00:00
parent 92ce0b3e5b
commit e30b25b2bc
7 changed files with 311 additions and 5 deletions
+2 -1
View File
@@ -39,7 +39,8 @@ func NewRoot(version string) *cobra.Command {
"KEY_ENCRYPTION_KEY is never written into an archive. What an archive\n" +
"records is a fingerprint of it, so a restore can tell you that the key\n" +
"you hold is the wrong one before it writes a database nobody can read.",
SilenceUsage: true,
SilenceUsage: true,
SilenceErrors: true,
}
f := root.PersistentFlags()