Skip to content

Commit 4ed63ba

Browse files
committed
make the -O, --output-file option use the current directory name as the default output filename.
1 parent 49fbfd6 commit 4ed63ba

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ const fs = require('fs');
77
const path = require('path');
88
const { execSync } = require('child_process');
99

10+
// Get the current directory name for default output file
11+
const getCurrentDirectoryName = () => {
12+
const currentPath = process.cwd();
13+
return path.basename(currentPath) + '.md';
14+
};
15+
1016
// Package information
1117
program
1218
.name('code2prompt-manager')
@@ -19,7 +25,7 @@ program
1925
.option('-d, --directory <path>', 'Directory to scan', '.')
2026
.option('-e, --extra-exclude <patterns>', 'Additional exclude patterns (comma-separated)')
2127
.option('-i, --include <patterns>', 'Include patterns (comma-separated)')
22-
.option('-O, --output-file <file>', 'Output file name', 'codebase.md')
28+
.option('-O, --output-file <file>', 'Output file name', getCurrentDirectoryName())
2329
.option('-F, --output-format <format>', 'Output format: markdown, json, or xml', 'markdown')
2430
.option('--include-priority', 'Include files in case of conflict between include and exclude patterns')
2531
.option('--full-directory-tree', 'List the full directory tree')

0 commit comments

Comments
 (0)