package cli import "github.com/spf13/cobra" func newHookCmd() *cobra.Command { cmd := &cobra.Command{ Use: "hook", Short: "Manage hook scripts", } cmd.AddCommand( &cobra.Command{ Use: "init", Short: "Initialize hooks directory with template scripts", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { m, err := newManagers("", "", "") if err != nil { return err } m.Hook.Init() return nil }, }, &cobra.Command{ Use: "list", Short: "Show hooks directory location and list scripts", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { m, err := newManagers("", "", "") if err != nil { return err } m.Hook.ListHooks() return nil }, }, &cobra.Command{ Use: "edit