ReviewCommand constructor
ReviewCommand({
- String name = 'review',
- String? repoRoot,
- ReviewProjectConfig? config,
- String? reviewDirectoryName,
- String? cliCommandDisplay,
- String? cliResolveCommand,
- List<
String> ? allowedSites, - bool includeServeSubcommand = false,
- Future<
void> ? serveStopSignal, - StringSink? out,
- StringSink? err,
Implementation
ReviewCommand({
String name = 'review',
String? repoRoot,
ReviewProjectConfig? config,
String? reviewDirectoryName,
String? cliCommandDisplay,
String? cliResolveCommand,
List<String>? allowedSites,
bool includeServeSubcommand = false,
Future<void>? serveStopSignal,
StringSink? out,
StringSink? err,
}) : _commandName = name,
_displayDirectory =
reviewDirectoryName ??
config?.reviewDirectoryName ??
defaultReviewDirectoryName {
final resolvedCliCommand =
cliResolveCommand ??
(cliCommandDisplay != null
? '${cliCommandDisplay.trim()} resolve'
: config?.cliResolveCommand);
final effectiveAllowedSites = allowedSites ?? config?.allowedSites;
_context = ReviewExecutionContext(
repoRoot: repoRoot,
config: config,
reviewDirectoryName: reviewDirectoryName,
cliResolveCommand: resolvedCliCommand,
allowedSites: effectiveAllowedSites,
out: out,
err: err,
parentResults: () => argResults,
globalResults: () => globalResults,
);
_addSiteOption(argParser, allowedSites: effectiveAllowedSites);
if (includeServeSubcommand) {
addSubcommand(ReviewServeCommand(_context, stopSignal: serveStopSignal));
}
addSubcommand(
ReviewListCommand(_context, allowedSites: effectiveAllowedSites),
);
addSubcommand(
ReviewPromptCommand(_context, allowedSites: effectiveAllowedSites),
);
addSubcommand(
ReviewResolveCommand(
_context,
allowedSites: effectiveAllowedSites,
displayDirectory: _displayDirectory,
),
);
addSubcommand(
ReviewClearCommand(
_context,
allowedSites: effectiveAllowedSites,
displayDirectory: _displayDirectory,
),
);
}