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 a102276
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 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, title string) {
cmd.DisableAutoGenTag = true

// create docs directory
Expand Down Expand Up @@ -43,7 +43,7 @@ title: ` + title + `
if strings.HasPrefix(c.Use, "help") {
continue
}
generateDocs(c, filename, title+" "+c.Use)
generateDocs(c, title+" "+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 a102276

Please sign in to comment.