NewCmd creates the "instance" command
()
| 32 | |
| 33 | // NewCmd creates the "instance" command |
| 34 | func NewCmd() *cobra.Command { |
| 35 | cmd := &cobra.Command{ |
| 36 | Use: "pgbouncer", |
| 37 | Short: "pgbouncer management subfeatures", |
| 38 | SilenceErrors: true, |
| 39 | PersistentPreRunE: func(_ *cobra.Command, _ []string) error { |
| 40 | return os.MkdirAll(postgres.TemporaryDirectory, 0o1777) //nolint:gosec |
| 41 | }, |
| 42 | RunE: func(_ *cobra.Command, _ []string) error { |
| 43 | return fmt.Errorf("missing subcommand") |
| 44 | }, |
| 45 | } |
| 46 | |
| 47 | cmd.AddCommand(run.NewCmd()) |
| 48 | |
| 49 | return cmd |
| 50 | } |