runSyslogCli function

Future<int> runSyslogCli(
  1. List<String> args
)

CLI adapter for fdb syslog.

Validates arguments, delegates to runSyslog, then pipes the resulting SyslogStream to stdout. Handles SIGINT for follow mode by calling SyslogStream.cancel so the subprocess is terminated cleanly.

Implementation

Future<int> runSyslogCli(List<String> args) => runCliAdapter(
      ArgParser()
        ..addOption(
          'since',
          defaultsTo: '5m',
          help: 'Time window (e.g. 30s, 5m, 1h)',
        )
        ..addOption('predicate', help: 'Filter substring')
        ..addOption('last', help: 'Show last N lines')
        ..addFlag('follow', negatable: false, help: 'Stream live logs'),
      args,
      _execute,
    );