root.go 706 B

12345678910111213141516171819202122232425262728
  1. package access_token
  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: "access_token",
  9. Short: "Manage Netmaker user access tokens",
  10. Long: `Manage a Netmaker user's access tokens. This command allows you to create, delete, and list access tokens for a user.`,
  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. }