Skip to content

Commit 49fbfd6

Browse files
committed
Update the command generation to use the comma-separated format for exclude and include patterns, which is more concise and matches the code2prompt documentation.
1 parent 42e8baf commit 49fbfd6

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

index.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -299,21 +299,20 @@ async function main() {
299299
cmd += ` --line-numbers`;
300300
}
301301

302-
// Add exclude options
302+
// Add exclude options - use a single -e flag with comma-separated patterns
303303
if (allExcludes.length > 0) {
304-
allExcludes.forEach(pattern => {
305-
cmd += ` -e "${pattern}"`;
306-
});
304+
cmd += ` -e "${allExcludes.join(',')}"`;
307305
}
308306

309-
// Add include options
307+
// Add include options - use a single -i flag with comma-separated patterns
310308
if (options.include) {
311-
options.include.split(',').forEach(pattern => {
312-
pattern = pattern.trim();
313-
if (pattern) {
314-
cmd += ` -i "${pattern}"`;
315-
}
316-
});
309+
const includePatterns = options.include.split(',')
310+
.map(pattern => pattern.trim())
311+
.filter(pattern => pattern);
312+
313+
if (includePatterns.length > 0) {
314+
cmd += ` -i "${includePatterns.join(',')}"`;
315+
}
317316
}
318317

319318
// Add the directory path at the end

0 commit comments

Comments
 (0)