MCPcopy Create free account
hub / github.com/cli/cli / subscriptionCommand

Function subscriptionCommand

evals/src/suites/events/commands.ts:28–37  ·  view source on GitHub ↗
(call: Call)

Source from the content-addressed store, hash-verified

26/** The `gh event subscription` subcommand a call ran, or "api" for a `gh api` call on the subscriptions API. Help
27 * requests are not counted. */
28export function subscriptionCommand(call: Call): "list" | "view" | "create" | "delete" | "api" | undefined {
29 if (call.kind !== "gh") return;
30 const { words, help } = command(call.arguments);
31 if (help) return;
32 if (words[0] === "event" && (words[1] === "subscription" || words[1] === "subscriptions")) {
33 const sub = words[2] === "ls" ? "list" : words[2];
34 if (sub === "list" || sub === "view" || sub === "create" || sub === "delete") return sub;
35 }
36 if (words[0] === "api" && /^\/?event-subscriptions(?:[/?]|$)/.test(words[1] ?? "")) return "api";
37}
38
39/** Whether a listener keeps listening after its first event, with `--follow` or a `--count` above 1. */
40export function persistentWait(call: Call): boolean {

Callers 1

gradeMethod · 0.85

Calls 1

commandFunction · 0.70

Tested by

no test coverage detected