Skip to content

Commit

Permalink
curio cli: Add --local to storage list cli
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Apr 3, 2024
1 parent 416d7ef commit f1c04c8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions cmd/curio/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,14 @@ var storageDetachCmd = &cli.Command{
}

var storageListCmd = &cli.Command{
Name: "list",
Usage: "list local storage paths",
Name: "list",
Usage: "list local storage paths",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "local",
Usage: "only list local storage paths",
},
},
Subcommands: []*cli.Command{
//storageListSectorsCmd,
},
Expand Down Expand Up @@ -238,6 +244,12 @@ var storageListCmd = &cli.Command{

sorted := make([]fsInfo, 0, len(st))
for id, decls := range st {
if cctx.Bool("local") {
if _, ok := local[id]; !ok {
continue
}
}

st, err := minerApi.StorageStat(ctx, id)
if err != nil {
sorted = append(sorted, fsInfo{ID: id, sectors: decls})
Expand Down

0 comments on commit f1c04c8

Please sign in to comment.