github.com/greenplum-db/gpbackup@v0.0.0-20240517212602-89daab1885b3/gprestore.go (about)

     1  // +build gprestore
     2  
     3  package main
     4  
     5  import (
     6  	"os"
     7  
     8  	"github.com/greenplum-db/gpbackup/options"
     9  	. "github.com/greenplum-db/gpbackup/restore"
    10  	"github.com/spf13/cobra"
    11  )
    12  
    13  func main() {
    14  	var rootCmd = &cobra.Command{
    15  		Use:     "gprestore",
    16  		Short:   "gprestore is the parallel restore utility for Greenplum",
    17  		Args:    cobra.NoArgs,
    18  		Version: GetVersion(),
    19  		Run: func(cmd *cobra.Command, args []string) {
    20  			defer DoTeardown()
    21  			DoValidation(cmd)
    22  			DoSetup()
    23  			DoRestore()
    24  		}}
    25  	rootCmd.SetArgs(options.HandleSingleDashes(os.Args[1:]))
    26  	DoInit(rootCmd)
    27  	if err := rootCmd.Execute(); err != nil {
    28  		os.Exit(2)
    29  	}
    30  }