Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "gh", Short: "A brief description of your application", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your application. For example: Cobra is a CLI library for Go that empowers applications. This application is a tool to generate the needed files to quickly create a Cobra application.`, Run: func(cmd *cobra.Command, args []string) { fmt.Printf("Start gh\n\n") url_byte, err := exec.Command("git", "config", "--get", "remote.origin.url").Output() if err != nil { fmt.Println(err) os.Exit(1) } url := string(url_byte) fmt.Println(url) r := regexp.MustCompile(`git@github.com:`) if r.MatchString(url) { url = r.ReplaceAllString(url, "https://github.com/") } fmt.Println(url) exec.Command("open", url).Run() }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.