github.com/olli-ai/jx/v2@v2.0.400-0.20210921045218-14731b4dd448/pkg/cmd/docs.go (about)

     1  package cmd
     2  
     3  import (
     4  	"github.com/olli-ai/jx/v2/pkg/cmd/helper"
     5  	"github.com/olli-ai/jx/v2/pkg/cmd/opts"
     6  	"github.com/spf13/cobra"
     7  
     8  	"github.com/pkg/browser"
     9  )
    10  
    11  const (
    12  	docsURL = "https://jenkins-x.io/documentation/"
    13  )
    14  
    15  /* open the docs - Jenkins X docs by default */
    16  func NewCmdDocs(commonOpts *opts.CommonOptions) *cobra.Command {
    17  	cmd := &cobra.Command{
    18  		Use:   "docs",
    19  		Short: "Open the documentation in a browser",
    20  		Run: func(cmd *cobra.Command, args []string) {
    21  			err := browser.OpenURL(docsURL)
    22  			helper.CheckErr(err)
    23  		},
    24  	}
    25  	return cmd
    26  }