isSubcommand reports whether arg is a recognized top-level subcommand and dispatches it. It returns true when a subcommand was handled.
()
| 31 | // isSubcommand reports whether arg is a recognized top-level subcommand and |
| 32 | // dispatches it. It returns true when a subcommand was handled. |
| 33 | func dispatchSubcommand() bool { |
| 34 | if len(os.Args) <= 1 { |
| 35 | return false |
| 36 | } |
| 37 | subcmd := os.Args[1] |
| 38 | switch subcmd { |
| 39 | case "server", "serve", "connect", "watch", "mcp-server", "mcp-serve", "acp", "gateway": |
| 40 | runSubcommand(subcmd, os.Args[2:]) |
| 41 | return true |
| 42 | case "daemon": |
| 43 | runDaemonSubcommand(os.Args[2:]) |
| 44 | return true |
| 45 | } |
| 46 | return false |
| 47 | } |
| 48 | |
| 49 | // printVersionInfo prints version details (including update check) and is used |
| 50 | // for the -version flag. |
no test coverage detected