chore: Fix typo, coral -> cobra (#5325)

This commit is contained in:
Y.Horie 2023-01-22 00:27:58 +09:00 committed by GitHub
parent c38a040e85
commit 8d6870fd06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -104,7 +104,7 @@ func init() {
rootCmd.SetHelpTemplate(rootCmd.HelpTemplate() + "\n" + fullDocsFooter + "\n") rootCmd.SetHelpTemplate(rootCmd.HelpTemplate() + "\n" + fullDocsFooter + "\n")
} }
func caddyCmdToCoral(caddyCmd Command) *cobra.Command { func caddyCmdToCobra(caddyCmd Command) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: caddyCmd.Name, Use: caddyCmd.Name,
Short: caddyCmd.Short, Short: caddyCmd.Short,

View file

@ -504,7 +504,7 @@ func RegisterCommand(cmd Command) {
if !commandNameRegex.MatchString(cmd.Name) { if !commandNameRegex.MatchString(cmd.Name) {
panic("invalid command name") panic("invalid command name")
} }
rootCmd.AddCommand(caddyCmdToCoral(cmd)) rootCmd.AddCommand(caddyCmdToCobra(cmd))
} }
var commandNameRegex = regexp.MustCompile(`^[a-z0-9]$|^([a-z0-9]+-?[a-z0-9]*)+[a-z0-9]$`) var commandNameRegex = regexp.MustCompile(`^[a-z0-9]$|^([a-z0-9]+-?[a-z0-9]*)+[a-z0-9]$`)