forked from TrueCloudLab/restic
hide index loading progress for JSON output
This commit is contained in:
parent
3fd0ad7448
commit
75f6bd89ed
15 changed files with 17 additions and 17 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue