Merge pull request #3903 from filecoin-project/3605-sector-list-option
Add an option to hide sectors in Removed from `sectors list`.
This commit is contained in:
commit
29913f4c41
@ -138,6 +138,12 @@ var sectorsStatusCmd = &cli.Command{
|
||||
var sectorsListCmd = &cli.Command{
|
||||
Name: "list",
|
||||
Usage: "List sectors",
|
||||
Flags: []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "show-removed",
|
||||
Usage: "show removed sectors",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
|
||||
if err != nil {
|
||||
@ -194,10 +200,11 @@ var sectorsListCmd = &cli.Command{
|
||||
continue
|
||||
}
|
||||
|
||||
if cctx.Bool("show-removed") || st.State != api.SectorState(sealing.Removed) {
|
||||
_, inSSet := commitedIDs[s]
|
||||
_, inASet := activeIDs[s]
|
||||
|
||||
fmt.Fprintf(w, "%d: %s\tsSet: %s\tactive: %s\ttktH: %d\tseedH: %d\tdeals: %v\t toUpgrade:%t\n",
|
||||
_, _ = fmt.Fprintf(w, "%d: %s\tsSet: %s\tactive: %s\ttktH: %d\tseedH: %d\tdeals: %v\t toUpgrade:%t\n",
|
||||
s,
|
||||
st.State,
|
||||
yesno(inSSet),
|
||||
@ -208,6 +215,7 @@ var sectorsListCmd = &cli.Command{
|
||||
st.ToUpgrade,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return w.Flush()
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user