Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny0826 committed Jan 8, 2024
1 parent cb3c55b commit 5fa4834
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func NewBaseCommand() *BaseCommand {
&CreateCommand{}, // create command
&CloudCommand{}, // cloud command
&ExportCommand{}, // export command
&DocsCommand{}, // docs command
)

return baseCmd
Expand Down
9 changes: 8 additions & 1 deletion cmd/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@ func (dc *DocsCommand) Init() {
}

func (dc *DocsCommand) runDocs(cmd *cobra.Command, args []string) error {
url := fmt.Sprintf("%s#/en-us/cli/kubecm_%s", DOCS, cmd.Parent().Use)
var url string
if cmd.Parent().Use == "kubecm" {
url = DOCS
} else {
url = fmt.Sprintf("%s#/en-us/cli/kubecm_%s", DOCS, cmd.Parent().Use)
}
fmt.Printf("Opened %s in your browser.\n", url)
return browser.OpenURL(url)
}

func docsExample() string {
return `
# Open kubecm website
kubecm docs
# Open add command document page
kubecm add docs
`
Expand Down

0 comments on commit 5fa4834

Please sign in to comment.