mirror of
https://github.com/restic/restic.git
synced 2024-12-23 08:16:36 +00:00
29 lines
433 B
Go
29 lines
433 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/fd0/khepri"
|
|
)
|
|
|
|
func commandList(repo *khepri.Repository, args []string) error {
|
|
if len(args) != 1 {
|
|
return errors.New("usage: list [blob|ref]")
|
|
}
|
|
|
|
tpe := khepri.NewTypeFromString(args[0])
|
|
|
|
ids, err := repo.ListIDs(tpe)
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
|
return nil
|
|
}
|
|
|
|
for _, id := range ids {
|
|
fmt.Printf("%v\n", id)
|
|
}
|
|
|
|
return nil
|
|
}
|