package cmd import ( "os" ) import ( "github.com/spf13/cobra" ) import ( "resource-server/cmd/crypto" "resource-server/cmd/httpserver" "resource-server/cmd/version" ) var rootCmd = &cobra.Command{ Use: "resource-server", Short: "rs", SilenceUsage: true, Long: `rs server`, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, } func init() { rootCmd.AddCommand(httpserver.StartCmd) rootCmd.AddCommand(version.StartCmd) rootCmd.AddCommand(crypto.StartCmd) } // Execute : apply commands func Execute() { if err := rootCmd.Execute(); err != nil { os.Exit(-1) } }