Skip to content

FileConcat is a Go tool that concatenates multiple code files, removes comments, and outputs the clean code to STDOUT.

License

Notifications You must be signed in to change notification settings

schubam/FileConcat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FileConcat

FileConcat is a Go tool that concatenates multiple code files, removes comments, and outputs the clean code to STDOUT.

Features

  • Concatenates multiple files into one.
  • Removes both single-line and multi-line comments.
  • Supports wildcard patterns for file selection.
  • Outputs the cleaned, concatenated code to STDOUT.

Installation

To build FileConcat from source, ensure you have Go installed, then clone this repository and run:

git clone https://github.com/schubam/FileConcat.git
cd FileConcat
go build -o FileConcat
## Usage

You can use FileConcat by passing in individual filenames or wildcard patterns. The results will be printed to STDOUT.

```bash
./FileConcat file1.swift file2.go "**/*.js"

Showing or Hiding Filenames

By default, FileConcat prepends the filename with a colon before each file's content. To control this behavior, use the -show-filenames flag:

  • Show filenames (default behavior):

    ./FileConcat -show-filenames=true file1.swift file2.go

    Output:

    file1.swift:
    <contents of file1.swift>
    
    file2.go:
    <contents of file2.go>
    
  • Hide filenames:

    ./FileConcat -show-filenames=false file1.swift file2.go

    Output:

    <contents of file1.swift>
    
    <contents of file2.go>
    

Contributing

Feel free to submit issues or pull requests if you have suggestions for improvements or new features.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

FileConcat is a Go tool that concatenates multiple code files, removes comments, and outputs the clean code to STDOUT.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages