root.go 595 B

12345678910111213141516171819202122232425262728
  1. package network_user
  2. import (
  3. "os"
  4. "github.com/spf13/cobra"
  5. )
  6. // rootCmd represents the base command when called without any subcommands
  7. var rootCmd = &cobra.Command{
  8. Use: "network_user",
  9. Short: "Manage Network Users",
  10. Long: `Manage Network Users`,
  11. }
  12. // GetRoot returns the root subcommand
  13. func GetRoot() *cobra.Command {
  14. return rootCmd
  15. }
  16. // Execute adds all child commands to the root command and sets flags appropriately.
  17. // This is called by main.main(). It only needs to happen once to the rootCmd.
  18. func Execute() {
  19. err := rootCmd.Execute()
  20. if err != nil {
  21. os.Exit(1)
  22. }
  23. }