merge method
Merge with another config, preferring non-null values from other.
Implementation
CliConfig merge(CliConfig other) => CliConfig(
command: other.command ?? command,
positionalArgs: other.positionalArgs.isNotEmpty
? other.positionalArgs
: positionalArgs,
flags: {...flags, ...other.flags},
options: {...options, ...other.options},
verbose: other.verbose || verbose,
quiet: other.quiet || quiet,
jsonOutput: other.jsonOutput || jsonOutput,
model: other.model ?? model,
apiKey: other.apiKey ?? apiKey,
maxTokens: other.maxTokens ?? maxTokens,
systemPrompt: other.systemPrompt ?? systemPrompt,
allowedTools: other.allowedTools.isNotEmpty
? other.allowedTools
: allowedTools,
permissionMode: other.permissionMode ?? permissionMode,
workDir: other.workDir ?? workDir,
sessionId: other.sessionId ?? sessionId,
continueSession: other.continueSession || continueSession,
printOnly: other.printOnly || printOnly,
dangerouslySkipPermissions:
other.dangerouslySkipPermissions || dangerouslySkipPermissions,
mcpServers: other.mcpServers.isNotEmpty ? other.mcpServers : mcpServers,
listen: other.listen || listen,
listenPort: other.listenPort ?? listenPort,
outputFormat: other.outputFormat ?? outputFormat,
);