mirror of
https://github.com/octoleo/restic.git
synced 2024-11-24 05:37:37 +00:00
read JSON/Quiet flag from the passed in globalOptions
This commit is contained in:
parent
cebce52c16
commit
4b3a0b4104
@ -594,7 +594,7 @@ func runFind(ctx context.Context, opts FindOptions, gopts GlobalOptions, args []
|
||||
f := &Finder{
|
||||
repo: repo,
|
||||
pat: pat,
|
||||
out: statefulOutput{ListLong: opts.ListLong, JSON: globalOptions.JSON},
|
||||
out: statefulOutput{ListLong: opts.ListLong, JSON: gopts.JSON},
|
||||
ignoreTrees: restic.NewIDSet(),
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
|
||||
func testRunFind(t testing.TB, wantJSON bool, gopts GlobalOptions, pattern string) []byte {
|
||||
buf, err := withCaptureStdout(func() error {
|
||||
globalOptions.JSON = wantJSON
|
||||
gopts.JSON = wantJSON
|
||||
|
||||
opts := FindOptions{}
|
||||
return runFind(context.TODO(), opts, gopts, []string{pattern})
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
|
||||
func testRunLs(t testing.TB, gopts GlobalOptions, snapshotID string) []string {
|
||||
buf, err := withCaptureStdout(func() error {
|
||||
globalOptions.Quiet = true
|
||||
gopts.Quiet = true
|
||||
opts := LsOptions{}
|
||||
return runLs(context.TODO(), opts, gopts, []string{snapshotID})
|
||||
})
|
||||
|
@ -176,7 +176,7 @@ func runRestore(ctx context.Context, opts RestoreOptions, gopts GlobalOptions,
|
||||
}
|
||||
|
||||
var progress *restoreui.Progress
|
||||
if !globalOptions.Quiet && !globalOptions.JSON {
|
||||
if !gopts.Quiet && !gopts.JSON {
|
||||
progress = restoreui.NewProgress(restoreui.NewProgressPrinter(term), calculateProgressInterval(!gopts.Quiet, gopts.JSON))
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
|
||||
func testRunSnapshots(t testing.TB, gopts GlobalOptions) (newest *Snapshot, snapmap map[restic.ID]Snapshot) {
|
||||
buf, err := withCaptureStdout(func() error {
|
||||
globalOptions.JSON = true
|
||||
gopts.JSON = true
|
||||
|
||||
opts := SnapshotOptions{}
|
||||
return runSnapshots(context.TODO(), opts, gopts, []string{})
|
||||
|
Loading…
Reference in New Issue
Block a user