packagecmdimport("go.jolheiser.com/tmpl/registry""github.com/rs/zerolog/log""github.com/urfave/cli/v2")varUpdate=&cli.Command{Name:"update",Usage:"Update a template",Description:"Update a template in the registry from the original source",ArgsUsage:"[name]",Action:runUpdate,}funcrunUpdate(ctx*cli.Context)error{ifctx.NArg()<1{returncli.ShowCommandHelp(ctx,ctx.Command.Name)}reg,err:=registry.Open(registryFlag)iferr!=nil{returnerr}tmpl,err:=reg.GetTemplate(ctx.Args().First())iferr!=nil{returnerr}iferr:=reg.UpdateTemplate(tmpl.Name);err!=nil{returnerr}log.Info().Msgf("Successfully updated %q",tmpl.Name)returnnil}