MCPcopy Create free account
hub / github.com/diillson/chatcli / dispatchSubcommand

Function dispatchSubcommand

main.go:33–47  ·  view source on GitHub ↗

isSubcommand reports whether arg is a recognized top-level subcommand and dispatches it. It returns true when a subcommand was handled.

()

Source from the content-addressed store, hash-verified

31// isSubcommand reports whether arg is a recognized top-level subcommand and
32// dispatches it. It returns true when a subcommand was handled.
33func 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.

Callers 1

mainFunction · 0.85

Calls 2

runSubcommandFunction · 0.85
runDaemonSubcommandFunction · 0.85

Tested by

no test coverage detected