cli: clueanup deadlines command

This commit is contained in:
Łukasz Magiera 2022-08-02 10:12:24 +02:00
parent b3cce636cc
commit 65ba7bd37d

View File

@ -247,7 +247,7 @@ var provingDeadlinesCmd = &cli.Command{
sectors := uint64(0) sectors := uint64(0)
faults := uint64(0) faults := uint64(0)
var PartitionSum int var partitionCount int
for _, partition := range partitions { for _, partition := range partitions {
if cctx.Bool("live") { if cctx.Bool("live") {
@ -257,7 +257,7 @@ var provingDeadlinesCmd = &cli.Command{
} }
if sc > 0 { if sc > 0 {
PartitionSum++ partitionCount++
} }
sectors += sc sectors += sc
@ -267,7 +267,7 @@ var provingDeadlinesCmd = &cli.Command{
return err return err
} }
PartitionSum++ partitionCount++
sectors += sc sectors += sc
} }
@ -283,7 +283,7 @@ var provingDeadlinesCmd = &cli.Command{
if di.Index == uint64(dlIdx) { if di.Index == uint64(dlIdx) {
cur += "\t(current)" cur += "\t(current)"
} }
_, _ = fmt.Fprintf(tw, "%d\t%d\t%d (%d)\t%d%s\n", dlIdx, PartitionSum, sectors, faults, provenPartitions, cur) _, _ = fmt.Fprintf(tw, "%d\t%d\t%d (%d)\t%d%s\n", dlIdx, partitionCount, sectors, faults, provenPartitions, cur)
} }
return tw.Flush() return tw.Flush()
@ -299,9 +299,6 @@ var provingDeadlineInfoCmd = &cli.Command{
Aliases: []string{"n"}, Aliases: []string{"n"},
Usage: "Print sector/fault numbers belonging to this deadline", Usage: "Print sector/fault numbers belonging to this deadline",
}, },
},
ArgsUsage: "<deadlineIdx>",
Flags: []cli.Flag{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "live", Name: "live",
Usage: "View deadline live sectors", Usage: "View deadline live sectors",
@ -309,6 +306,7 @@ var provingDeadlineInfoCmd = &cli.Command{
Aliases: []string{"l"}, Aliases: []string{"l"},
}, },
}, },
ArgsUsage: "<deadlineIdx>",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.Args().Len() != 1 { if cctx.Args().Len() != 1 {