MCPcopy
hub / github.com/yamadashy/repomix / validateWatchOptions

Function validateWatchOptions

src/cli/cliRun.ts:257–288  ·  view source on GitHub ↗
(directories: string[], options: CliOptions)

Source from the content-addressed store, hash-verified

255 * changes so error messages are not suppressed by --quiet/--stdout.
256 */
257const validateWatchOptions = (directories: string[], options: CliOptions): void => {
258 if (!options.watch) {
259 return;
260 }
261 if (options.remote) {
262 throw new RepomixError('--watch cannot be used with --remote. Watch mode only works with local directories.');
263 }
264 if (options.stdout) {
265 throw new RepomixError('--watch cannot be used with --stdout. Watch mode writes to a file.');
266 }
267 if (options.stdin) {
268 throw new RepomixError('--watch cannot be used with --stdin. Watch mode discovers files automatically.');
269 }
270 if (options.copy) {
271 throw new RepomixError(
272 '--watch cannot be used with --copy. Watch mode re-packs on every change, which would repeatedly overwrite the clipboard.',
273 );
274 }
275 if (options.splitOutput) {
276 throw new RepomixError(
277 '--watch cannot be used with --split-output. Watch mode does not yet support split output files.',
278 );
279 }
280 if (options.skillGenerate !== undefined) {
281 throw new RepomixError(
282 '--watch cannot be used with --skill-generate. Watch mode does not support skill generation.',
283 );
284 }
285 if (directories.length === 1 && isExplicitRemoteUrl(directories[0])) {
286 throw new RepomixError('--watch cannot be used with remote URLs. Watch mode only works with local directories.');
287 }
288};
289
290export const runCli = async (directories: string[], cwd: string, options: CliOptions) => {
291 // Detect stdout mode

Callers 1

runCliFunction · 0.85

Calls 1

isExplicitRemoteUrlFunction · 0.85

Tested by

no test coverage detected