diff --git a/docs/docs/08-references/01-cli.md b/docs/docs/08-references/01-cli.md index e436137d8e..68fd236ac3 100644 --- a/docs/docs/08-references/01-cli.md +++ b/docs/docs/08-references/01-cli.md @@ -11,7 +11,7 @@ Ignite CLI offers everything you need to scaffold, test, build, and launch your **Synopsis** -Ignite CLI is a tool for creating sovereign blockchains built with Cosmos SDK, the world’s +Ignite CLI is a tool for creating sovereign blockchains built with Cosmos SDK, the world's most popular modular blockchain framework. Ignite CLI offers everything you need to scaffold, test, build, and launch your blockchain. diff --git a/ignite/internal/tools/gen-cli-docs/main.go b/ignite/internal/tools/gen-cli-docs/main.go index 7076da90bb..0883b1736b 100644 --- a/ignite/internal/tools/gen-cli-docs/main.go +++ b/ignite/internal/tools/gen-cli-docs/main.go @@ -6,7 +6,6 @@ import ( "bufio" "bytes" "context" - "flag" "fmt" "io" "log" @@ -23,7 +22,8 @@ import ( "github.com/ignite/cli/v29/ignite/services/plugin" ) -const head = `--- +const ( + head = `--- description: Ignite CLI docs. --- @@ -31,16 +31,16 @@ description: Ignite CLI docs. Documentation for Ignite CLI. ` + outFlag = "out" +) func main() { - outPath := flag.String("out", ".", ".md file path to place Ignite CLI docs inside") - flag.Parse() - if err := run(*outPath); err != nil { + if err := run(); err != nil { log.Fatal(err) } } -func run(outPath string) error { +func run() error { // We want to have documentation for commands that are implemented in plugins. // To do that, we need to add the related plugins in the config. // To avoid conflicts with user config, set an alternate config dir in tmp. @@ -71,6 +71,8 @@ func run(outPath string) error { return err } defer cleanUp() + cmd.Flags().String(outFlag, ".", ".md file path to place Ignite CLI docs inside") + cmd.Flags().MarkHidden(outFlag) // Run ExecuteC so cobra adds the completion command. cmd, err = cmd.ExecuteC() @@ -78,6 +80,11 @@ func run(outPath string) error { return err } + outPath, err := cmd.Flags().GetString(outFlag) + if err != nil { + return nil + } + return generate(cmd, outPath) }