diff --git a/vantagectl/internal/cmd/verify.go b/vantagectl/internal/cmd/verify.go index f8e23ae..758947b 100644 --- a/vantagectl/internal/cmd/verify.go +++ b/vantagectl/internal/cmd/verify.go @@ -33,9 +33,9 @@ func newVerifyCmd() *cobra.Command { opt := backup.VerifyOptions{Archive: archive} - // A database is optional here. resolveGlobals fails without a URI, - // so its error is a signal to verify the archive alone rather than - // a reason to stop. + // A database is optional here. resolveGlobals fails without a URI or + // without a resolvable database name, and either error is a signal to + // verify the archive alone rather than a reason to stop. var client *mongo.Client if g, gerr := resolveGlobals(c); gerr == nil { client, err = connect(ctx, g) @@ -47,8 +47,8 @@ func newVerifyCmd() *cobra.Command { opt.Database = g.Database opt.KeyHex = g.KeyHex } else { - fmt.Fprintln(c.ErrOrStderr(), - "note: no MongoDB URI, so this checks the archive and the key only") + fmt.Fprintf(c.ErrOrStderr(), + "note: %v, so this checks the archive and the key only\n", gerr) } rep, err := backup.Verify(ctx, opt)