mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-26 13:43:47 +03:00
chore: Fix typo, coral -> cobra (#5325)
This commit is contained in:
parent
c38a040e85
commit
8d6870fd06
2 changed files with 2 additions and 2 deletions
|
@ -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,
|
||||||
|
|
|
@ -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]$`)
|
||||||
|
|
Loading…
Reference in a new issue