Skip to content

Commit 4465f0a

Browse files
committed
feat: Rename 'height' flag to 'epoch' in ChainListCmd and update usage
Signed-off-by: Jakub Sztandera <[email protected]>
1 parent 58d77af commit 4465f0a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

cli/chain.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -581,12 +581,12 @@ var ChainListCmd = &cli.Command{
581581
Aliases: []string{"love"},
582582
Usage: "View a segment of the chain",
583583
Flags: []cli.Flag{
584-
&cli.Uint64Flag{Name: "height", DefaultText: "current head"},
584+
&cli.Uint64Flag{Name: "epoch", Aliases: []string{"height"}, DefaultText: "current head"},
585585
&cli.IntFlag{Name: "count", Value: 30},
586586
&cli.StringFlag{
587-
Name: "format",
588-
Usage: "specify the format to print out tipsets using placeholders like <height>, <time>, <blocks>, <tipset>, <weight>, <json_tipset>",
589-
Value: "<height>: (<time>) <blocks>",
587+
Name: "format",
588+
Usage: "specify the format to print out tipsets using placeholders: <epoch>, <time>, <blocks>, <weight>, <tipset>, <json_tipset>\n",
589+
Value: "<epoch>: (<time>) <blocks>",
590590
},
591591
&cli.BoolFlag{
592592
Name: "gas-stats",
@@ -932,7 +932,9 @@ func handleHamtAddress(ctx context.Context, api v0api.FullNode, r cid.Cid) error
932932
}
933933

934934
func printTipSet(format string, ts *types.TipSet, afmt *AppFmt) {
935-
format = strings.ReplaceAll(format, "<height>", fmt.Sprint(ts.Height()))
935+
format = strings.ReplaceAll(format, "<epoch>", fmt.Sprint(ts.Height()))
936+
format = strings.ReplaceAll(format, "<height>", fmt.Sprint(ts.Height())) // backwards compatibility
937+
936938
format = strings.ReplaceAll(format, "<time>", time.Unix(int64(ts.MinTimestamp()), 0).Format(time.Stamp))
937939
blks := "[ "
938940
for _, b := range ts.Blocks() {

0 commit comments

Comments
 (0)