From db779195506b905cd2a5f447dc118698036d3a47 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 3 Aug 2024 17:22:56 +0200 Subject: [PATCH] migrate: show warning if migration is unknown --- cmd/restic/cmd_migrate.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/restic/cmd_migrate.go b/cmd/restic/cmd_migrate.go index e89980050..7e472ff12 100644 --- a/cmd/restic/cmd_migrate.go +++ b/cmd/restic/cmd_migrate.go @@ -74,8 +74,10 @@ func checkMigrations(ctx context.Context, repo restic.Repository, printer progre func applyMigrations(ctx context.Context, opts MigrateOptions, gopts GlobalOptions, repo restic.Repository, args []string, term *termstatus.Terminal, printer progress.Printer) error { var firsterr error for _, name := range args { + found := false for _, m := range migrations.All { if m.Name() == name { + found = true ok, reason, err := m.Check(ctx, repo) if err != nil { return err @@ -119,6 +121,9 @@ func applyMigrations(ctx context.Context, opts MigrateOptions, gopts GlobalOptio printer.P("migration %v: success\n", m.Name()) } } + if !found { + printer.E("unknown migration %v", name) + } } return firsterr