Execute is the main entry point for the CLI
()
| 35 | |
| 36 | // Execute is the main entry point for the CLI |
| 37 | func Execute() { |
| 38 | if len(os.Args) < 2 { |
| 39 | rootCmd() |
| 40 | return |
| 41 | } |
| 42 | |
| 43 | cmd := os.Args[1] |
| 44 | |
| 45 | switch cmd { |
| 46 | case "start": |
| 47 | startCmd(os.Args[2:]) |
| 48 | case "user": |
| 49 | userCmd(os.Args[2:]) |
| 50 | case "version": |
| 51 | versionCmd() |
| 52 | default: |
| 53 | fmt.Printf("Unknown command %s\n", cmd) |
| 54 | rootCmd() |
| 55 | os.Exit(1) |
| 56 | } |
| 57 | } |
no test coverage detected