ctl: add /i alias for inject
This commit is contained in:
parent
573c9f4462
commit
c3afe1453d
|
|
@ -304,6 +304,14 @@ var agentCtlHandlers = map[string]rdwrHandler{
|
|||
ctx.Agent.InjectRewrite(text)
|
||||
return []byte("ok\n"), nil
|
||||
},
|
||||
"i": func(ctx HandlerCtx, args []string) ([]byte, error) {
|
||||
text := strings.Join(args, " ")
|
||||
if text == "" {
|
||||
return nil, fmt.Errorf("inject requires text")
|
||||
}
|
||||
ctx.Agent.InjectRewrite(text)
|
||||
return []byte("ok\n"), nil
|
||||
},
|
||||
"agent": func(ctx HandlerCtx, args []string) ([]byte, error) {
|
||||
if len(args) == 0 {
|
||||
return []byte(ctx.Agent.Profile() + "\n"), nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue