plugin-barman-cloud/cmd/manager/main.go
Armando Ruocco 240077c771
feat(spike): restore (#29)
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2024-11-06 16:01:56 +01:00

38 lines
818 B
Go

package main
import (
"fmt"
"os"
"github.com/cloudnative-pg/machinery/pkg/log"
"github.com/spf13/cobra"
"github.com/cloudnative-pg/plugin-barman-cloud/internal/cmd/instance"
"github.com/cloudnative-pg/plugin-barman-cloud/internal/cmd/operator"
"github.com/cloudnative-pg/plugin-barman-cloud/internal/cmd/restore"
)
func main() {
cobra.EnableTraverseRunHooks = true
logFlags := &log.Flags{}
rootCmd := &cobra.Command{
Use: "manager [cmd]",
PersistentPreRunE: func(_ *cobra.Command, _ []string) error {
logFlags.ConfigureLogging()
return nil
},
}
logFlags.AddFlags(rootCmd.PersistentFlags())
rootCmd.AddCommand(instance.NewCmd())
rootCmd.AddCommand(operator.NewCmd())
rootCmd.AddCommand(restore.NewCmd())
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}