123456789101112131415161718192021222324252627282930313233343536 |
- package cmd
- import (
- "os"
- )
- import (
- "github.com/spf13/cobra"
- )
- import (
- "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)
- }
- // Execute : apply commands
- func Execute() {
- if err := rootCmd.Execute(); err != nil {
- os.Exit(-1)
- }
- }
|