Skip to content

codingseb/CSharpFilesMerger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.
Default value is equivalent to : -u DoNotMove

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.

About

A command line utility to merge multiple C# file (*.cs) into one

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages