parseReadTarget maps 1-or-2 positional args to (name, relpath); a lone " / " splits on the first '/', and relpath "" reads the main SKILL.md.
(args []string)
| 159 | // parseReadTarget maps 1-or-2 positional args to (name, relpath); a lone |
| 160 | // "<a>/<b>" splits on the first '/', and relpath "" reads the main SKILL.md. |
| 161 | func parseReadTarget(args []string) (name, relpath string, err error) { |
| 162 | switch len(args) { |
| 163 | case 1: |
| 164 | name, relpath = skillcontent.SplitArg(args[0]) |
| 165 | return name, relpath, nil |
| 166 | case 2: |
| 167 | return args[0], args[1], nil |
| 168 | default: |
| 169 | return "", "", errs.NewValidationError(errs.SubtypeInvalidArgument, |
| 170 | "read requires 1 or 2 arguments: <name>[/<path>] [path]"). |
| 171 | WithHint("run 'lark-cli skills read --help'") |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | // readGuidance routes cross-skill "../lark-foo/..." references back through |
| 176 | // `skills read lark-foo/...`: the path guard rejects a literal "../", so the |
no test coverage detected