Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/sdk/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const USAGE = [
'flows tick start --schedule-id <id> --interval-ms <ms> [--epoch-ms <ms>] [--max-catch-up <n>] [--poll-interval-ms <ms>] [--data-dir <dir>] <spec.json>',
'flows resume [--json] [--no-spawn] [--data-dir <dir>] <run-id>',
'flows hn-monitor start [--data-dir <dir>] [--poll-interval-ms <n>] <spec.json>',
].join(' ');
].join('\n');

/**
* `FLOWS_NO_SPAWN=1` is `--no-spawn` for a whole environment: the lever for CI
Expand All @@ -70,6 +70,11 @@ export async function runCli(
args: readonly string[],
io: CliIo = PROCESS_IO,
): Promise<CliExitCode> {
if (args.length === 1 && (args[0] === '--help' || args[0] === '-h')) {
io.stdout(USAGE);
return 0;
}

const parsed = parseArgs(args);
if (parsed === undefined) {
const report = inputFailureReport({ kind: 'invalid_invocation', message: USAGE });
Expand Down Expand Up @@ -393,7 +398,7 @@ function emitRunReport(execution: RunExecution, json: boolean, io: CliIo): void
return;
}
if (report.runId === undefined) return;
const completed = report.completedSteps === undefined ? '' : ` (${report.completedSteps} steps)`;
const completed = report.completedSteps === undefined ? '' : ` (${report.completedSteps} ${report.completedSteps === 1 ? 'step' : 'steps'})`;
const reason = report.completionReason === undefined
? ''
: ` completionReason: ${report.completionReason}`;
Expand Down
Loading