NodeStartCommand constructor

NodeStartCommand({
  1. Future<void> untilStopped()?,
  2. void leave(
    1. int code
    )?,
})

Creates the node-start command.

untilStopped and leave are seams: Ctrl-C and exit in production, and in a test a future it can complete and a recorder for the exit code — so the agent's whole lifecycle runs in-process, where coverage is collected and where exit would otherwise take the test runner with it.

Implementation

NodeStartCommand({
  Future<void> Function()? untilStopped,
  void Function(int code)? leave,
}) : _untilStopped = untilStopped ?? _awaitSignal,
     _leave = leave ?? exit {
  addNodeStartOptions(argParser);
  argParser.addFlag(
    'verbose',
    abbr: 'v',
    negatable: false,
    help:
        "Show the connection lifecycle, not just failures — every attempt, "
        'handshake and heartbeat.',
  );
}