@@ -11,6 +11,7 @@ FileFusion is a powerful command-line tool designed to concatenate and process f
1111- Powerful file pattern matching and exclusion
1212- Concurrent file processing for better performance
1313- Size limits for both individual files and total output
14+ - Detailed size reporting (uncompressed and final sizes with --clean)
1415- Preserves file metadata and structure
1516- Safe file handling with atomic writes
1617- Cross-platform compatibility
@@ -178,8 +179,28 @@ filefusion --max-file-size 20MB /path/to/project
178179# Increase total output size limit to 100MB
179180filefusion --max-output-size 100MB /path/to/project
180181
181- # Set both limits
182- filefusion --max-file-size 20MB --max-output-size 100MB /path/to/project
182+ # Set both limits and enable cleaning to see size reduction
183+ filefusion --max-file-size 20MB --max-output-size 100MB --clean /path/to/project
184+ ```
185+
186+ When using the ` --clean ` flag, FileFusion will show both:
187+
188+ - The uncompressed size (before cleaning)
189+ - The final size (after cleaning)
190+
191+ Example output with ` --clean ` :
192+
193+ ```
194+ Processing /path/to/project:
195+ Found 10 files matching pattern
196+ Uncompressed size: 1.2MB
197+ Final size (with --clean): will be calculated after processing
198+
199+ Matched files:
200+ - src/main.go (500KB)
201+ - src/utils.go (700KB)
202+
203+ Final size (with --clean): 800KB
183204```
184205
185206Size limits accept suffixes:
@@ -236,6 +257,92 @@ filefusion \
236257 /path/to/project
237258```
238259
260+ ### Code Cleaning and Size Optimization
261+
262+ ``` bash
263+ # Clean and optimize a Go project
264+ filefusion \
265+ --pattern " *.go" \
266+ --exclude " *_test.go" \
267+ --clean \
268+ --clean-remove-comments \
269+ --clean-remove-logging \
270+ --output optimized.xml \
271+ /path/to/go/project
272+
273+ # Clean TypeScript/JavaScript with preserved documentation
274+ filefusion \
275+ --pattern " *.ts,*.js" \
276+ --clean \
277+ --clean-preserve-doc-comments \
278+ --clean-remove-logging \
279+ --clean-optimize-whitespace \
280+ --output web-optimized.xml \
281+ /path/to/web/project
282+
283+ # Maximum cleaning for size reduction
284+ filefusion \
285+ --pattern " *.go,*.js,*.py" \
286+ --clean \
287+ --clean-remove-comments \
288+ --clean-remove-imports \
289+ --clean-remove-logging \
290+ --clean-remove-getters-setters \
291+ --clean-optimize-whitespace \
292+ --clean-remove-empty-lines \
293+ --output minimal-size.xml \
294+ /path/to/project
295+
296+ # Clean with size monitoring
297+ filefusion \
298+ --pattern " *.{go,js,py,java}" \
299+ --clean \
300+ --clean-remove-comments \
301+ --clean-optimize-whitespace \
302+ --max-file-size 20MB \
303+ --max-output-size 100MB \
304+ --output monitored-clean.xml \
305+ /path/to/project
306+ ```
307+
308+ ### Combining Features
309+
310+ ``` bash
311+ # Clean code and monitor size in multiple directories
312+ filefusion \
313+ --pattern " *.{go,js,ts}" \
314+ --exclude " **/{test,tests,vendor}/**" \
315+ --clean \
316+ --clean-remove-comments \
317+ --clean-preserve-doc-comments \
318+ --clean-optimize-whitespace \
319+ /path/to/project1 /path/to/project2
320+
321+ # Process large codebase with size optimization
322+ filefusion \
323+ --pattern " *.{go,js,ts,py,java,cpp,h}" \
324+ --exclude " **/{test,build,dist,vendor}/**" \
325+ --clean \
326+ --clean-remove-comments \
327+ --clean-optimize-whitespace \
328+ --max-file-size 50MB \
329+ --max-output-size 500MB \
330+ --output large-project.xml \
331+ /path/to/large/project
332+
333+ # Documentation-preserving clean with size monitoring
334+ filefusion \
335+ --pattern " *.{go,js,py}" \
336+ --exclude " **/vendor/**" \
337+ --clean \
338+ --clean-preserve-doc-comments \
339+ --clean-remove-logging \
340+ --clean-optimize-whitespace \
341+ --max-file-size 10MB \
342+ --output docs-preserved.xml \
343+ /path/to/project
344+ ```
345+
239346## Output Format Examples
240347
241348### XML Output Structure
0 commit comments