Skip to content

Commit 2df7468

Browse files
authored
Added generate-docs command to tealdbg (#3830)
When generating the CLI documentation for the Developer Portal it was noticed that tealdbg was missing. Much like goal, kmd, and algokey, added the "generate-docs" command option to generate the markdown output.
1 parent c9f4151 commit 2df7468

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cmd/tealdbg/main.go

+12
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,23 @@ import (
2323

2424
"github.com/gorilla/mux"
2525
"github.com/spf13/cobra"
26+
"github.com/spf13/cobra/doc"
2627

2728
cmdutil "github.com/algorand/go-algorand/cmd/util"
2829
)
2930

3031
func main() {
32+
// Hidden command to generate docs in a given directory
33+
// tealdbg generate-docs [path]
34+
if len(os.Args) == 3 && os.Args[1] == "generate-docs" {
35+
err := doc.GenMarkdownTree(rootCmd, os.Args[2])
36+
if err != nil {
37+
log.Println(err)
38+
os.Exit(1)
39+
}
40+
os.Exit(0)
41+
}
42+
3143
if err := rootCmd.Execute(); err != nil {
3244
log.Println(err)
3345
os.Exit(1)

0 commit comments

Comments
 (0)