github.com/gfleury/gobbs@v0.0.0-20200831213239-44ca2b94c1a1/users/usr.go (about) 1 package users 2 3 import ( 4 "fmt" 5 6 "github.com/spf13/cobra" 7 ) 8 9 func init() { 10 UserRoot.AddCommand(List) 11 //UserRoot.AddCommand(Create) 12 } 13 14 // UserRoot cmd root for cobra 15 var UserRoot = &cobra.Command{ 16 Use: "user", 17 Aliases: []string{"us"}, 18 Short: "Interact with users", 19 Args: cobra.MinimumNArgs(0), 20 RunE: func(cmd *cobra.Command, args []string) error { 21 if len(args) == 0 { 22 return List.RunE(cmd, args) 23 } 24 return fmt.Errorf("Commnand not found") 25 }, 26 }