diff --git a/cmd/restic/cmd_cache.go b/cmd/restic/cmd_cache.go index efc632b07..f94c23747 100644 --- a/cmd/restic/cmd_cache.go +++ b/cmd/restic/cmd_cache.go @@ -58,7 +58,7 @@ func (opts *CacheOptions) AddFlags(f *pflag.FlagSet) { } func runCache(opts CacheOptions, gopts GlobalOptions, args []string, term ui.Terminal) error { - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) if len(args) > 0 { return errors.Fatal("the cache command expects no arguments, only options - please see `restic help cache` for usage and flags") diff --git a/cmd/restic/cmd_copy.go b/cmd/restic/cmd_copy.go index 004a223ce..341537067 100644 --- a/cmd/restic/cmd_copy.go +++ b/cmd/restic/cmd_copy.go @@ -70,7 +70,7 @@ func (opts *CopyOptions) AddFlags(f *pflag.FlagSet) { } func runCopy(ctx context.Context, opts CopyOptions, gopts GlobalOptions, args []string, term ui.Terminal) error { - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) secondaryGopts, isFromRepo, err := fillSecondaryGlobalOpts(ctx, opts.secondaryRepoOptions, gopts, "destination", printer) if err != nil { return err diff --git a/cmd/restic/cmd_debug.go b/cmd/restic/cmd_debug.go index 8498224c8..8dcc3cc8d 100644 --- a/cmd/restic/cmd_debug.go +++ b/cmd/restic/cmd_debug.go @@ -188,7 +188,7 @@ func dumpIndexes(ctx context.Context, repo restic.ListerLoaderUnpacked, wr io.Wr } func runDebugDump(ctx context.Context, gopts GlobalOptions, args []string, term ui.Terminal) error { - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) if len(args) != 1 { return errors.Fatal("type not specified") @@ -459,7 +459,7 @@ func storePlainBlob(id restic.ID, prefix string, plain []byte, printer progress. } func runDebugExamine(ctx context.Context, gopts GlobalOptions, opts DebugExamineOptions, args []string, term ui.Terminal) error { - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) if opts.ExtractPack && gopts.NoLock { return fmt.Errorf("--extract-pack and --no-lock are mutually exclusive") diff --git a/cmd/restic/cmd_key_add.go b/cmd/restic/cmd_key_add.go index 00343e17a..13785d43b 100644 --- a/cmd/restic/cmd_key_add.go +++ b/cmd/restic/cmd_key_add.go @@ -61,7 +61,7 @@ func runKeyAdd(ctx context.Context, gopts GlobalOptions, opts KeyAddOptions, arg return fmt.Errorf("the key add command expects no arguments, only options - please see `restic help key add` for usage and flags") } - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) ctx, repo, unlock, err := openWithAppendLock(ctx, gopts, false, printer) if err != nil { return err diff --git a/cmd/restic/cmd_key_passwd.go b/cmd/restic/cmd_key_passwd.go index b472d4da9..3e1be711b 100644 --- a/cmd/restic/cmd_key_passwd.go +++ b/cmd/restic/cmd_key_passwd.go @@ -56,7 +56,7 @@ func runKeyPasswd(ctx context.Context, gopts GlobalOptions, opts KeyPasswdOption return fmt.Errorf("the key passwd command expects no arguments, only options - please see `restic help key passwd` for usage and flags") } - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) ctx, repo, unlock, err := openWithExclusiveLock(ctx, gopts, false, printer) if err != nil { return err diff --git a/cmd/restic/cmd_list.go b/cmd/restic/cmd_list.go index 3e8068901..fc425f07d 100644 --- a/cmd/restic/cmd_list.go +++ b/cmd/restic/cmd_list.go @@ -45,7 +45,7 @@ Exit status is 12 if the password is incorrect. } func runList(ctx context.Context, gopts GlobalOptions, args []string, term ui.Terminal) error { - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) if len(args) != 1 { return errors.Fatal("type not specified") diff --git a/cmd/restic/cmd_migrate.go b/cmd/restic/cmd_migrate.go index 87f2e429a..8e1d23c04 100644 --- a/cmd/restic/cmd_migrate.go +++ b/cmd/restic/cmd_migrate.go @@ -136,7 +136,7 @@ func applyMigrations(ctx context.Context, opts MigrateOptions, gopts GlobalOptio } func runMigrate(ctx context.Context, opts MigrateOptions, gopts GlobalOptions, args []string, term ui.Terminal) error { - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) ctx, repo, unlock, err := openWithExclusiveLock(ctx, gopts, false, printer) if err != nil { diff --git a/cmd/restic/cmd_mount.go b/cmd/restic/cmd_mount.go index b85e1be5f..a476422fd 100644 --- a/cmd/restic/cmd_mount.go +++ b/cmd/restic/cmd_mount.go @@ -116,7 +116,7 @@ func (opts *MountOptions) AddFlags(f *pflag.FlagSet) { } func runMount(ctx context.Context, opts MountOptions, gopts GlobalOptions, args []string, term ui.Terminal) error { - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) if opts.TimeTemplate == "" { return errors.Fatal("time template string cannot be empty") diff --git a/cmd/restic/cmd_prune.go b/cmd/restic/cmd_prune.go index 479ad80af..3adc6a90e 100644 --- a/cmd/restic/cmd_prune.go +++ b/cmd/restic/cmd_prune.go @@ -168,7 +168,7 @@ func runPrune(ctx context.Context, opts PruneOptions, gopts GlobalOptions, term return errors.Fatal("--no-lock is only applicable in combination with --dry-run for prune command") } - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) ctx, repo, unlock, err := openWithExclusiveLock(ctx, gopts, opts.DryRun && gopts.NoLock, printer) if err != nil { return err diff --git a/cmd/restic/cmd_recover.go b/cmd/restic/cmd_recover.go index 9d9b96d68..274066eed 100644 --- a/cmd/restic/cmd_recover.go +++ b/cmd/restic/cmd_recover.go @@ -49,7 +49,7 @@ func runRecover(ctx context.Context, gopts GlobalOptions, term ui.Terminal) erro return err } - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) ctx, repo, unlock, err := openWithExclusiveLock(ctx, gopts, false, printer) if err != nil { return err diff --git a/cmd/restic/cmd_repair_index.go b/cmd/restic/cmd_repair_index.go index 924574031..52383f720 100644 --- a/cmd/restic/cmd_repair_index.go +++ b/cmd/restic/cmd_repair_index.go @@ -73,7 +73,7 @@ func newRebuildIndexCommand() *cobra.Command { } func runRebuildIndex(ctx context.Context, opts RepairIndexOptions, gopts GlobalOptions, term ui.Terminal) error { - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) ctx, repo, unlock, err := openWithExclusiveLock(ctx, gopts, false, printer) if err != nil { diff --git a/cmd/restic/cmd_repair_packs.go b/cmd/restic/cmd_repair_packs.go index c2f3c55d0..e8d6a1196 100644 --- a/cmd/restic/cmd_repair_packs.go +++ b/cmd/restic/cmd_repair_packs.go @@ -53,7 +53,7 @@ func runRepairPacks(ctx context.Context, gopts GlobalOptions, term ui.Terminal, return errors.Fatal("no ids specified") } - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) ctx, repo, unlock, err := openWithExclusiveLock(ctx, gopts, false, printer) if err != nil { diff --git a/cmd/restic/cmd_repair_snapshots.go b/cmd/restic/cmd_repair_snapshots.go index ff53e72b5..49ab7b151 100644 --- a/cmd/restic/cmd_repair_snapshots.go +++ b/cmd/restic/cmd_repair_snapshots.go @@ -76,7 +76,7 @@ func (opts *RepairOptions) AddFlags(f *pflag.FlagSet) { } func runRepairSnapshots(ctx context.Context, gopts GlobalOptions, opts RepairOptions, args []string, term ui.Terminal) error { - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) ctx, repo, unlock, err := openWithExclusiveLock(ctx, gopts, opts.DryRun, printer) if err != nil { diff --git a/cmd/restic/cmd_rewrite.go b/cmd/restic/cmd_rewrite.go index eb9f6b7ec..b2d771bb4 100644 --- a/cmd/restic/cmd_rewrite.go +++ b/cmd/restic/cmd_rewrite.go @@ -296,7 +296,7 @@ func runRewrite(ctx context.Context, opts RewriteOptions, gopts GlobalOptions, a return errors.Fatal("Nothing to do: no excludes provided and no new metadata provided") } - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) var ( repo *repository.Repository diff --git a/cmd/restic/cmd_self_update.go b/cmd/restic/cmd_self_update.go index 167229040..b4173ab78 100644 --- a/cmd/restic/cmd_self_update.go +++ b/cmd/restic/cmd_self_update.go @@ -88,7 +88,7 @@ func runSelfUpdate(ctx context.Context, opts SelfUpdateOptions, gopts GlobalOpti } } - printer := newTerminalProgressPrinter(gopts.JSON, gopts.verbosity, term) + printer := newTerminalProgressPrinter(false, gopts.verbosity, term) printer.P("writing restic to %v", opts.Output) v, err := selfupdate.DownloadLatestStableRelease(ctx, opts.Output, version, printer.P)