From f1c04c8f96191ebc963c90f59aeaf5d5bfe96602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 3 Apr 2024 16:25:59 +0200 Subject: [PATCH] curio cli: Add --local to storage list cli --- cmd/curio/storage.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cmd/curio/storage.go b/cmd/curio/storage.go index 7b57e9438..c5fe77e18 100644 --- a/cmd/curio/storage.go +++ b/cmd/curio/storage.go @@ -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, }, @@ -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})