(argv)
| 881 | } |
| 882 | |
| 883 | async function handleStatus(argv) { |
| 884 | const { options, positionals } = parseCommandInput(argv, { |
| 885 | valueOptions: ["cwd", "timeout-ms", "poll-interval-ms"], |
| 886 | booleanOptions: ["json", "all", "wait"] |
| 887 | }); |
| 888 | |
| 889 | const cwd = resolveCommandCwd(options); |
| 890 | const reference = positionals[0] ?? ""; |
| 891 | if (reference) { |
| 892 | const snapshot = options.wait |
| 893 | ? await waitForSingleJobSnapshot(cwd, reference, { |
| 894 | timeoutMs: options["timeout-ms"], |
| 895 | pollIntervalMs: options["poll-interval-ms"] |
| 896 | }) |
| 897 | : buildSingleJobSnapshot(cwd, reference); |
| 898 | outputCommandResult(snapshot, renderJobStatusReport(snapshot.job), options.json); |
| 899 | return; |
| 900 | } |
| 901 | |
| 902 | if (options.wait) { |
| 903 | throw new Error("`status --wait` requires a job id."); |
| 904 | } |
| 905 | |
| 906 | const report = buildStatusSnapshot(cwd, { all: options.all }); |
| 907 | outputResult(renderStatusPayload(report, options.json), options.json); |
| 908 | } |
| 909 | |
| 910 | function handleResult(argv) { |
| 911 | const { options, positionals } = parseCommandInput(argv, { |
no test coverage detected