https://github.com/codingseb/csharpfilesmerger
A command line utility to merge multiple C# file (*.cs) into one
https://github.com/codingseb/csharpfilesmerger
Last synced: 2 months ago
JSON representation
A command line utility to merge multiple C# file (*.cs) into one
- Host: GitHub
- URL: https://github.com/codingseb/csharpfilesmerger
- Owner: codingseb
- License: mit
- Created: 2021-05-26T17:31:04.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-06-04T13:28:13.000Z (over 4 years ago)
- Last Synced: 2025-03-31T14:59:47.762Z (9 months ago)
- Language: C#
- Size: 86.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CSharpFilesMerger
A command line utility to merge multiple C# file (*.cs) into one
* Scan a directory or give a list of files
* Multiple way to manage `using`
* Merge `partial class` in one class
* Ignore `*\obj\*`, `*\Properties\*` and `*\Merge.cs`
## Parameters
By default the application search for *.cs files in the working directory of the application.\
You can specify an other directory as first argument.\
It can be an absolute path or a relative path from working directory.
### Syntax:
```CSharpFilesMerger [workingDirectory] [OPTIONS]```
### Options:
|Option | Description |
|-----------------|-------------|
| `-h, --help` | Show this help text
(is exclusive with others options except `-w`)|
| `-v, --version` | Show the version of the application
(is exclusive with others options except `-w`)|
| `-r, --recursive` | Search for *.cs file recursively from working directory or specified directory.
Do not work with `-f, --files`|
| `-f, --files` | To specify the list of files to merge. Only these files will be merged.
Each file must be separate by a semicolon ";".
Each file can be specify as absolute path or relative to working directory or specified directory.
**Example** : `-f "a.cs;..\b.cs;C:\myDirectory\c.cs"`
*Remark : When this option is active files are merged in the order of the list.*|
| `-o, --out` | To specify the fileName of the output file where *.cs files are merged.
Can be specify as absolute path or relative to working directory or specified directory.
**Example** : `-o "MyOutputFile.cs"`
**Example** : `-o "C:\myDirectory\MyOutputFile.cs"`
**Default value** is equivalent to : `-o "Merged.cs"`|
| `-u, --usings` | To specify where to put usings (globally vs in namespaces).
Must be followed by one of these 3 options :
- **DoNotMove** : keep the found "using" globally if it is defined outside of any namespace or in the specific namespace if found in a namespace.
- **Global** : Force all "using" to be defined globally in the merged result.
- **Namespace** : Force all "using" to be defined in namespaces in the merged result.
*Remark : All usings are ordered and print only one time by usings location.*|
| `-s, --start` | To open the result file at the end.
By default try to open the file with the default program for *.cs files.
An other program can be optionally specify with the path of the program
**Example** : `-s "C:\Program Files\MyEditor\MyEditor.exe"`|
| `-w, --wait` | Ask the user to press a key to exit at the end. |