diff options
Diffstat (limited to 'cmd/list.go')
-rw-r--r-- | cmd/list.go | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/cmd/list.go b/cmd/list.go index 99d5f24..5849975 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -3,13 +3,14 @@ package cmd import ( "fmt" "flag" + "golang.flu0r1ne.net/zfdiff/snap" ) func List(params []string) { flags := flag.NewFlagSet("list", flag.ExitOnError) var withPaths bool - + withName := aliasedBoolVar( flags, &withPaths, @@ -32,6 +33,19 @@ func List(params []string) { reference := flags.Arg(0) - fmt.Printf(reference) - fmt.Printf("Your flag is: %t", withPaths); + snaps := snap.GetTimeseries(reference) + + for _, s := range snaps { + if s.Reference == "" { + continue + } + + fmt.Printf("%s", s.Name) + + if withPaths { + fmt.Printf(", %s", s.Reference) + } + + fmt.Println("") + } } |