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

Function todoSubcommand

cli/plugins/builtin_todo_caps.go:61–72  ·  view source on GitHub ↗

todoSubcommand pulls the subcommand from either the JSON envelope or the first positional token. Mirrors the helpers in @coder / @park / @scheduler.

(args []string)

Source from the content-addressed store, hash-verified

59// or the first positional token. Mirrors the helpers in @coder /
60// @park / @scheduler.
61func todoSubcommand(args []string) string {
62 if len(args) == 0 {
63 return ""
64 }
65 first := strings.TrimSpace(args[0])
66 if strings.HasPrefix(first, "{") {
67 if v := extractStringArg([]string{first}, "cmd", "command"); v != "" {
68 return v
69 }
70 }
71 return first
72}
73
74// JSONSchema returns the draft-2020-12 schema for @todo input. Three
75// subcommand shapes are enumerated via oneOf so the validator rejects

Callers 2

IsReadOnlyMethod · 0.85
DescribeCallMethod · 0.85

Calls 1

extractStringArgFunction · 0.85

Tested by

no test coverage detected