NewCmd creates the "instance" command
()
| 39 | |
| 40 | // NewCmd creates the "instance" command |
| 41 | func NewCmd() *cobra.Command { |
| 42 | cmd := &cobra.Command{ |
| 43 | Use: "instance", |
| 44 | Short: "Instance management subfeatures", |
| 45 | RunE: func(_ *cobra.Command, _ []string) error { |
| 46 | return fmt.Errorf("missing subcommand") |
| 47 | }, |
| 48 | PersistentPreRunE: func(_ *cobra.Command, _ []string) error { |
| 49 | return os.MkdirAll(postgres.TemporaryDirectory, 0o1777) //nolint:gosec |
| 50 | }, |
| 51 | } |
| 52 | |
| 53 | cmd.AddCommand(initdb.NewCmd()) |
| 54 | cmd.AddCommand(join.NewCmd()) |
| 55 | cmd.AddCommand(run.NewCmd()) |
| 56 | cmd.AddCommand(status.NewCmd()) |
| 57 | cmd.AddCommand(pgbasebackup.NewCmd()) |
| 58 | cmd.AddCommand(restore.NewCmd()) |
| 59 | cmd.AddCommand(restoresnapshot.NewCmd()) |
| 60 | cmd.AddCommand(upgrade.NewCmd()) |
| 61 | |
| 62 | return cmd |
| 63 | } |