addNavigationOptions function

void addNavigationOptions(
  1. ArgParser parser
)

Add standard navigation options to an ArgParser.

Adds: -s, -r, -b, -p, -R, -w, -i, -o, -T, -x, --exclude-projects, --recursion-exclude, --exclude-dev, -m, --no-skip, --modes.

Implementation

void addNavigationOptions(ArgParser parser) {
  parser.addOption('scan', abbr: 's', help: 'Scan directory for projects');
  parser.addFlag(
    'recursive',
    abbr: 'r',
    negatable: true,
    defaultsTo: false,
    help: 'Scan directories recursively (use --no-recursive to disable)',
  );
  parser.addFlag(
    'build-order',
    abbr: 'b',
    negatable: true,
    defaultsTo: false,
    help:
        'Sort projects in dependency build order '
        '(use --no-build-order to disable)',
  );
  parser.addFlag(
    'exclude-dev',
    negatable: false,
    help: 'Exclude dev_dependencies from build-order sorting (the default)',
  );
  parser.addFlag(
    'include-dev',
    negatable: false,
    help: 'Include dev_dependencies in build-order sorting',
  );
  parser.addOption(
    'project',
    abbr: 'p',
    help: 'Project(s) to run (comma-separated, globs supported)',
  );
  parser.addOption(
    'root',
    abbr: 'R',
    help: 'Workspace root (bare: detected, path: specified workspace)',
  );
  parser.addFlag(
    'workspace-recursion',
    abbr: 'w',
    negatable: false,
    help: 'Shell out to sub-workspaces instead of skipping',
  );
  parser.addFlag(
    'inner-first-git',
    abbr: 'i',
    negatable: false,
    help: 'Scan git repos, process innermost (deepest) first',
  );
  parser.addFlag(
    'outer-first-git',
    abbr: 'o',
    negatable: false,
    help: 'Scan git repos, process outermost (shallowest) first',
  );
  parser.addFlag(
    'top-repo',
    abbr: 'T',
    negatable: false,
    help: 'Find topmost git repo by traversing up from current directory',
  );
  parser.addMultiOption(
    'exclude',
    abbr: 'x',
    help: 'Exclude patterns (path-based globs)',
  );
  parser.addMultiOption(
    'exclude-projects',
    help:
        'Exclude projects by name or path '
        '(e.g. zom_*, xternal/tom_module_basics/*)',
  );
  parser.addMultiOption(
    'recursion-exclude',
    help: 'Exclude patterns during recursive scan',
  );
  parser.addOption(
    'modules',
    abbr: 'm',
    help:
        'Include only projects within the given repositories: a repository '
        'ID, or a name or path matched as whole path segments '
        '(comma-separated, e.g. BAS,d4rt)',
  );
  parser.addFlag(
    'no-skip',
    negatable: false,
    help: 'Ignore skip markers (tom_skip.yaml, *_skip.yaml)',
  );
  parser.addOption(
    'modes',
    help:
        'Active modes for config processing '
        '(comma-separated, e.g. DEV,CI).',
  );
}