diff --git a/cmd/restic/cmd_backup.go b/cmd/restic/cmd_backup.go index 09d5191b5..aabdeba54 100644 --- a/cmd/restic/cmd_backup.go +++ b/cmd/restic/cmd_backup.go @@ -547,7 +547,7 @@ func runBackup(ctx context.Context, opts BackupOptions, gopts GlobalOptions, ter progressPrinter.V("load index files") } - bar := newTerminalProgressMax(!gopts.Quiet, 0, "index files loaded", term) + bar := newTerminalProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded", term) err = repo.LoadIndex(ctx, bar) if err != nil { diff --git a/cmd/restic/cmd_cat.go b/cmd/restic/cmd_cat.go index fe4314179..f311eee88 100644 --- a/cmd/restic/cmd_cat.go +++ b/cmd/restic/cmd_cat.go @@ -169,7 +169,7 @@ func runCat(ctx context.Context, gopts GlobalOptions, args []string) error { return err case "blob": - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") err = repo.LoadIndex(ctx, bar) if err != nil { return err @@ -198,7 +198,7 @@ func runCat(ctx context.Context, gopts GlobalOptions, args []string) error { return errors.Fatalf("could not find snapshot: %v\n", err) } - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") err = repo.LoadIndex(ctx, bar) if err != nil { return err diff --git a/cmd/restic/cmd_copy.go b/cmd/restic/cmd_copy.go index 32d21e50b..3f410fec6 100644 --- a/cmd/restic/cmd_copy.go +++ b/cmd/restic/cmd_copy.go @@ -99,11 +99,11 @@ func runCopy(ctx context.Context, opts CopyOptions, gopts GlobalOptions, args [] } debug.Log("Loading source index") - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") if err := srcRepo.LoadIndex(ctx, bar); err != nil { return err } - bar = newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar = newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") debug.Log("Loading destination index") if err := dstRepo.LoadIndex(ctx, bar); err != nil { return err diff --git a/cmd/restic/cmd_debug.go b/cmd/restic/cmd_debug.go index 5890b4a38..6ced508ff 100644 --- a/cmd/restic/cmd_debug.go +++ b/cmd/restic/cmd_debug.go @@ -469,7 +469,7 @@ func runDebugExamine(ctx context.Context, gopts GlobalOptions, args []string) er } } - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") err = repo.LoadIndex(ctx, bar) if err != nil { return err diff --git a/cmd/restic/cmd_diff.go b/cmd/restic/cmd_diff.go index a82700358..bedbaae5d 100644 --- a/cmd/restic/cmd_diff.go +++ b/cmd/restic/cmd_diff.go @@ -363,7 +363,7 @@ func runDiff(ctx context.Context, opts DiffOptions, gopts GlobalOptions, args [] if !gopts.JSON { Verbosef("comparing snapshot %v to %v:\n\n", sn1.ID().Str(), sn2.ID().Str()) } - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") if err = repo.LoadIndex(ctx, bar); err != nil { return err } diff --git a/cmd/restic/cmd_dump.go b/cmd/restic/cmd_dump.go index 970d323bb..9e811bf61 100644 --- a/cmd/restic/cmd_dump.go +++ b/cmd/restic/cmd_dump.go @@ -152,7 +152,7 @@ func runDump(ctx context.Context, opts DumpOptions, gopts GlobalOptions, args [] return errors.Fatalf("failed to find snapshot: %v", err) } - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") err = repo.LoadIndex(ctx, bar) if err != nil { return err diff --git a/cmd/restic/cmd_find.go b/cmd/restic/cmd_find.go index d1c6e6628..7a6c4196f 100644 --- a/cmd/restic/cmd_find.go +++ b/cmd/restic/cmd_find.go @@ -589,7 +589,7 @@ func runFind(ctx context.Context, opts FindOptions, gopts GlobalOptions, args [] if err != nil { return err } - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") if err = repo.LoadIndex(ctx, bar); err != nil { return err } diff --git a/cmd/restic/cmd_ls.go b/cmd/restic/cmd_ls.go index 9f1b64d60..eaff272e0 100644 --- a/cmd/restic/cmd_ls.go +++ b/cmd/restic/cmd_ls.go @@ -173,7 +173,7 @@ func runLs(ctx context.Context, opts LsOptions, gopts GlobalOptions, args []stri return err } - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") if err = repo.LoadIndex(ctx, bar); err != nil { return err } diff --git a/cmd/restic/cmd_mount.go b/cmd/restic/cmd_mount.go index 39bcd6729..34411fe37 100644 --- a/cmd/restic/cmd_mount.go +++ b/cmd/restic/cmd_mount.go @@ -130,7 +130,7 @@ func runMount(ctx context.Context, opts MountOptions, gopts GlobalOptions, args } } - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") err = repo.LoadIndex(ctx, bar) if err != nil { return err diff --git a/cmd/restic/cmd_prune.go b/cmd/restic/cmd_prune.go index 3b9590595..2f9d3069a 100644 --- a/cmd/restic/cmd_prune.go +++ b/cmd/restic/cmd_prune.go @@ -187,7 +187,7 @@ func runPruneWithRepo(ctx context.Context, opts PruneOptions, gopts GlobalOption Verbosef("loading indexes...\n") // loading the index before the snapshots is ok, as we use an exclusive lock here - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") err := repo.LoadIndex(ctx, bar) if err != nil { return err diff --git a/cmd/restic/cmd_recover.go b/cmd/restic/cmd_recover.go index b8035d102..b7eaea087 100644 --- a/cmd/restic/cmd_recover.go +++ b/cmd/restic/cmd_recover.go @@ -58,7 +58,7 @@ func runRecover(ctx context.Context, gopts GlobalOptions) error { } Verbosef("load index files\n") - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") if err = repo.LoadIndex(ctx, bar); err != nil { return err } diff --git a/cmd/restic/cmd_repair_snapshots.go b/cmd/restic/cmd_repair_snapshots.go index a7d3af4a8..4c15cd465 100644 --- a/cmd/restic/cmd_repair_snapshots.go +++ b/cmd/restic/cmd_repair_snapshots.go @@ -89,7 +89,7 @@ func runRepairSnapshots(ctx context.Context, gopts GlobalOptions, opts RepairOpt return err } - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") if err := repo.LoadIndex(ctx, bar); err != nil { return err } diff --git a/cmd/restic/cmd_restore.go b/cmd/restic/cmd_restore.go index 11ce5e4a5..6e3c3a757 100644 --- a/cmd/restic/cmd_restore.go +++ b/cmd/restic/cmd_restore.go @@ -173,7 +173,7 @@ func runRestore(ctx context.Context, opts RestoreOptions, gopts GlobalOptions, return errors.Fatalf("failed to find snapshot: %v", err) } - bar := newTerminalProgressMax(!gopts.Quiet, 0, "index files loaded", term) + bar := newTerminalProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded", term) err = repo.LoadIndex(ctx, bar) if err != nil { return err diff --git a/cmd/restic/cmd_rewrite.go b/cmd/restic/cmd_rewrite.go index 008c133d1..816df71a9 100644 --- a/cmd/restic/cmd_rewrite.go +++ b/cmd/restic/cmd_rewrite.go @@ -212,7 +212,7 @@ func runRewrite(ctx context.Context, opts RewriteOptions, gopts GlobalOptions, a return err } - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") if err = repo.LoadIndex(ctx, bar); err != nil { return err } diff --git a/cmd/restic/cmd_stats.go b/cmd/restic/cmd_stats.go index 900000439..63048b455 100644 --- a/cmd/restic/cmd_stats.go +++ b/cmd/restic/cmd_stats.go @@ -98,7 +98,7 @@ func runStats(ctx context.Context, opts StatsOptions, gopts GlobalOptions, args if err != nil { return err } - bar := newProgressMax(!gopts.Quiet, 0, "index files loaded") + bar := newProgressMax(!gopts.Quiet && !gopts.JSON, 0, "index files loaded") if err = repo.LoadIndex(ctx, bar); err != nil { return err }