feat(cli): top-level ls alias for list
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -161,9 +161,9 @@ func Run(args []string, out, errOut io.Writer) int {
|
|||||||
}
|
}
|
||||||
cmd, rest := args[0], args[1:]
|
cmd, rest := args[0], args[1:]
|
||||||
role := commandRole(args)
|
role := commandRole(args)
|
||||||
switch cmd {
|
switch normalizeVerb(cmd) {
|
||||||
case "list", "get", "search", "ack":
|
case "list", "get", "search", "ack":
|
||||||
return runAgent(cmd, rest, role, out, errOut)
|
return runAgent(normalizeVerb(cmd), rest, role, out, errOut)
|
||||||
case "send":
|
case "send":
|
||||||
return runSend(rest, role, out, errOut)
|
return runSend(rest, role, out, errOut)
|
||||||
case "account":
|
case "account":
|
||||||
|
|||||||
@@ -81,3 +81,13 @@ func b64AgentKey() string {
|
|||||||
// 32 bytes of 0x01, base64 — distinct from b64Key so slot mix-ups surface.
|
// 32 bytes of 0x01, base64 — distinct from b64Key so slot mix-ups surface.
|
||||||
return "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE="
|
return "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE="
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestTopLevelLsAlias(t *testing.T) {
|
||||||
|
adminEnv(t)
|
||||||
|
// `ls` with no --account must hit the same usage path as `list` (CodeUsage
|
||||||
|
// envelope on stdout, exit 2) — proving it routed to the agent list command.
|
||||||
|
code, out, _ := run(t, "ls")
|
||||||
|
if code != 2 || !strings.Contains(out, "account") {
|
||||||
|
t.Fatalf("ls should alias list (usage about --account): code=%d out=%q", code, out)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user