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

Method Execute

pkg/coder/engine/engine.go:192–227  ·  view source on GitHub ↗

Execute dispatches a subcommand with the given args.

(ctx context.Context, cmd string, args []string)

Source from the content-addressed store, hash-verified

190
191// Execute dispatches a subcommand with the given args.
192func (e *Engine) Execute(ctx context.Context, cmd string, args []string) error {
193 switch cmd {
194 case "read":
195 return e.handleRead(args)
196 case "write":
197 return e.handleWrite(args)
198 case "patch":
199 return e.handlePatch(args)
200 case "multipatch":
201 return e.handleMultipatch(args)
202 case "tree":
203 return e.handleTree(args)
204 case "search":
205 return e.handleSearch(ctx, args)
206 case "exec":
207 return e.handleExec(ctx, args)
208 case "rollback":
209 return e.handleRollback(args)
210 case "clean":
211 return e.handleClean(args)
212 case "git-status":
213 return e.handleGitStatus(ctx, args)
214 case "git-diff":
215 return e.handleGitDiff(ctx, args)
216 case "git-log":
217 return e.handleGitLog(ctx, args)
218 case "git-changed":
219 return e.handleGitChanged(ctx, args)
220 case "git-branch":
221 return e.handleGitBranch(ctx, args)
222 case "test":
223 return e.handleTest(ctx, args)
224 default:
225 return fmt.Errorf("comando desconhecido: %s", cmd)
226 }
227}
228
229func (e *Engine) printf(format string, a ...interface{}) {
230 _, _ = fmt.Fprintf(e.Out, format, a...)

Callers 15

TestEngineExecuteUnknownFunction · 0.95
ExecuteWithStreamMethod · 0.95
ExecuteWithStreamMethod · 0.95
ExecuteWithStreamMethod · 0.95
ExecuteWithStreamMethod · 0.95
smartCommitScriptFunction · 0.95
reviewChangesScriptFunction · 0.95
diffReviewScriptFunction · 0.95
scanLintScriptFunction · 0.95
auditDepsScriptFunction · 0.95
updateDepsScriptFunction · 0.95

Calls 15

handleReadMethod · 0.95
handleWriteMethod · 0.95
handlePatchMethod · 0.95
handleMultipatchMethod · 0.95
handleTreeMethod · 0.95
handleSearchMethod · 0.95
handleExecMethod · 0.95
handleRollbackMethod · 0.95
handleCleanMethod · 0.95
handleGitStatusMethod · 0.95
handleGitDiffMethod · 0.95
handleGitLogMethod · 0.95