SyncCommand constructor

SyncCommand()

Implementation

SyncCommand() {
  argParser
    ..addFlag(
      'force',
      negatable: false,
      help:
          'Rewrite every output file even if its contents already match. '
          'Use when an external process has touched lib/l10n/ or you want '
          'to refresh mtimes for a downstream watcher.',
    )
    ..addFlag(
      'dry-run',
      negatable: false,
      help:
          'Show which files would change without writing anything. '
          'Exits non-zero if any file is out of date — useful as a CI '
          'gate that the committed outputs match the source.',
    )
    ..addOption(
      'platform',
      help:
          'Sync only the named platform from dialect.yaml (e.g. '
          '`--platform backend`). Default: every configured platform.',
      valueHelp: 'name',
    )
    ..addFlag(
      'adopt',
      negatable: false,
      help:
          'Recover orphan keys — keys that exist in a generated output but '
          'not in the source (someone edited a generated file by hand). '
          'Pull them back into dialect/source/<locale>.arb, then sync. '
          'Without this (or --prune), sync refuses when it would delete '
          'orphan keys.',
    )
    ..addFlag(
      'prune',
      negatable: false,
      help:
          'Confirm the deletion of orphan keys (present in the output, '
          'absent from the source) and regenerate without them. Opt-in on '
          'purpose: pruning throws away whatever strings live only in the '
          'generated file.',
    )
    ..addFlag(
      'verify',
      negatable: false,
      help:
          'Exit non-zero if the project still has check errors after '
          'syncing. Sync always reports the post-sync state in one line; '
          'this makes CI fail on it, so `dialect sync --verify` is the '
          'whole gate.',
    );
}