mirror of
https://github.com/restic/restic.git
synced 2026-11-28 15:26:48 +00:00
Introduce Verbosef
This commit is contained in:
1 parent
4388474cdc
commit
a43733d552
5 files changed
+20
-23
No files matched your search
@@ -3,14 +3,11 @@ package main
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/restic/restic/backend"
|
||||
)
|
||||
|
||||
type CmdList struct {
|
||||
w io.Writer
|
||||
global *GlobalOptions
|
||||
}
|
||||
|
||||
@@ -29,10 +26,6 @@ func (cmd CmdList) Usage() string {
|
||||
}
|
||||
|
||||
func (cmd CmdList) Execute(args []string) error {
|
||||
if cmd.w == nil {
|
||||
cmd.w = os.Stdout
|
||||
}
|
||||
|
||||
if len(args) != 1 {
|
||||
return fmt.Errorf("type not specified, Usage: %s", cmd.Usage())
|
||||
}
|
||||
@@ -51,7 +44,7 @@ func (cmd CmdList) Execute(args []string) error {
|
||||
}
|
||||
|
||||
for blob := range s.Index().Each(nil) {
|
||||
fmt.Fprintln(cmd.w, blob.ID)
|
||||
cmd.global.Printf("%s\n", blob.ID)
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -70,7 +63,7 @@ func (cmd CmdList) Execute(args []string) error {
|
||||
}
|
||||
|
||||
for id := range s.List(t, nil) {
|
||||
fmt.Fprintf(cmd.w, "%s\n", id)
|
||||
cmd.global.Printf("%s\n", id)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user