From 8702da906f177cd10e12133286844018e15a0307 Mon Sep 17 00:00:00 2001 From: Antoine Eddi <5222525+aeddi@users.noreply.github.com> Date: Mon, 20 Jan 2025 17:26:37 +0100 Subject: [PATCH] chore: fix gnohealth command/subcommand help (#3555) This PR fixes a detail, the help descriptions of the gnohealth command that are incorrect. --- contribs/gnohealth/health.go | 24 ------------------- .../gnohealth/internal/timestamp/timestamp.go | 2 +- contribs/gnohealth/main.go | 15 +++++++++++- 3 files changed, 15 insertions(+), 26 deletions(-) delete mode 100644 contribs/gnohealth/health.go diff --git a/contribs/gnohealth/health.go b/contribs/gnohealth/health.go deleted file mode 100644 index 5118cac5fa5..00000000000 --- a/contribs/gnohealth/health.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -import ( - "github.com/gnolang/gno/contribs/gnohealth/internal/timestamp" - "github.com/gnolang/gno/tm2/pkg/commands" -) - -func newHealthCmd(io commands.IO) *commands.Command { - cmd := commands.NewCommand( - commands.Metadata{ - ShortUsage: " [flags] [...]", - ShortHelp: "gno health check suite", - LongHelp: "Gno health check suite, to verify that different parts of Gno are working correctly", - }, - commands.NewEmptyConfig(), - commands.HelpExec, - ) - - cmd.AddSubCommands( - timestamp.NewTimestampCmd(io), - ) - - return cmd -} diff --git a/contribs/gnohealth/internal/timestamp/timestamp.go b/contribs/gnohealth/internal/timestamp/timestamp.go index 50521b9130f..cb5dab44f91 100644 --- a/contribs/gnohealth/internal/timestamp/timestamp.go +++ b/contribs/gnohealth/internal/timestamp/timestamp.go @@ -35,7 +35,7 @@ func NewTimestampCmd(io commands.IO) *commands.Command { return commands.NewCommand( commands.Metadata{ Name: "timestamp", - ShortUsage: "[flags]", + ShortUsage: "timestamp [flags]", ShortHelp: "check if block timestamps are drifting", LongHelp: "This command checks if block timestamps are drifting on a blockchain by connecting to a specified node via RPC.", }, diff --git a/contribs/gnohealth/main.go b/contribs/gnohealth/main.go index 4325c657976..a4a23369710 100644 --- a/contribs/gnohealth/main.go +++ b/contribs/gnohealth/main.go @@ -4,11 +4,24 @@ import ( "context" "os" + "github.com/gnolang/gno/contribs/gnohealth/internal/timestamp" "github.com/gnolang/gno/tm2/pkg/commands" ) func main() { - cmd := newHealthCmd(commands.NewDefaultIO()) + cmd := commands.NewCommand( + commands.Metadata{ + ShortUsage: " [flags]", + LongHelp: "Gno health check suite, to verify that different parts of Gno are working correctly", + }, + commands.NewEmptyConfig(), + commands.HelpExec, + ) + + io := commands.NewDefaultIO() + cmd.AddSubCommands( + timestamp.NewTimestampCmd(io), + ) cmd.Execute(context.Background(), os.Args[1:]) }