This is a tool for enclosing single statements in braces (and other cosmetic fixes) in C and C++ code
$ ./code-format --help
OVERVIEW: This is a tool for enclosing single statements in braces (and other cosmetic fixes) in C and C++ code
USAGE: ./code-format file [-o <file>] [--fix-file-endings] [--fix-single-statement] [-h] [-V]
OPTIONS:
-o <file> Output file name.
--fix-file-endings Change file ending to one new-line symbol.
--fix-single-statement Enclose single-statement blocks in brackets,
format `if`-`else if`-`else`-sequences.
-h, --help Display this information.
-V, --version Display version.
Perform these steps to build the project (in linux, for other platforms the steps are similar):
-
Clone
code-format
repository and enter itgit clone https://github.com/gbuzykin/code-format cd code-format
-
Initialize and update
uxs
submodulegit submodule update --init
-
Then, compilation script should be created using
cmake
tool. To use the default C++ compiler just issue (for new enough version ofcmake
)cmake -S . -B build
or to make building scripts for debug or optimized configurations issue the following
cmake -S . -B build -DCMAKE_BUILD_TYPE="Debug"
or
cmake -S . -B build -DCMAKE_BUILD_TYPE="Release"
-
Enter created folder
build
and runmake
cd build make
to use several parallel processes (e.g. 8) for building run
make
with-j
keymake -j 8