Skip to content

Commit

Permalink
fix command names
Browse files Browse the repository at this point in the history
  • Loading branch information
chicoxyzzy committed Jul 11, 2024
1 parent ea91775 commit 5545c2d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cli/generate_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

var isDocsBuild = true

func generateDocs(cmd *cobra.Command, filename string, title string) {
func generateDocs(cmd *cobra.Command, filename string) {
cmd.DisableAutoGenTag = true

// create docs directory
Expand All @@ -22,7 +22,7 @@ func generateDocs(cmd *cobra.Command, filename string, title string) {
err := doc.GenMarkdownTreeCustom(cmd, "./docs",
func(_ string) string {
return `---
title: ` + title + `
title: ` + filename + `
---
`
Expand All @@ -43,7 +43,7 @@ title: ` + title + `
if strings.HasPrefix(c.Use, "help") {
continue
}
generateDocs(c, filename, title+" "+c.Use)
generateDocs(c, filename+" "+c.Use)
}
}
}
2 changes: 1 addition & 1 deletion cli/generate_docs_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import "github.com/spf13/cobra"

var isDocsBuild = false

func generateDocs(_ *cobra.Command, _ string, _ string) {
func generateDocs(_ *cobra.Command, _ string) {
// do nothing if the build tag "docs" is not set
}
7 changes: 1 addition & 6 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,7 @@ func createMainCommand() *cobra.Command {
cmd.AddCommand(versionCommand())

// Generate markdown documentation
generateDocs(loginCommand(), "dispatch_login.md", "dispatch login")
generateDocs(initCommand(), "dispatch_init.md", "dispatch init")
generateDocs(switchCommand(DispatchConfigPath), "dispatch_switch.md", "dispatch switch")
generateDocs(verificationCommand(), "dispatch_verification.md", "dispatch verification")
generateDocs(runCommand(), "dispatch_run.md", "dispatch run")
generateDocs(versionCommand(), "dispatch_version.md", "dispatch version")
generateDocs(cmd, "dispatch")

return cmd
}
Expand Down

0 comments on commit 5545c2d

Please sign in to comment.