Skip to content
This repository was archived by the owner on Feb 24, 2024. It is now read-only.

Commit 29b77bb

Browse files
committed
Update README.md
Changes: - fix typos and grammar - improve formatting
1 parent 0de0c1a commit 29b77bb

File tree

1 file changed

+33
-18
lines changed

1 file changed

+33
-18
lines changed

README.md

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,93 @@
11
# cpp-merge
2-
Tool to produce single source file from multiple C/C++ files. Is was developed mainly to use in programming contests
3-
in which solution must be submitted as single source file.
2+
3+
Tool to produce a single source file from multiple C/C++ files. It was developed mainly to be used in programming
4+
contests that require submitting a solution as a single source file.
45

56
## Install
7+
68
#### Prerequisites
9+
710
* node
811
* npm
912
* yarn (optional)
1013

1114
#### Installation from npm
15+
1216
```
1317
npm install -g cpp-merge
1418
```
1519

1620
#### Installation from source
21+
1722
##### Clone git repository
23+
1824
```
1925
git clone git@github.com:RandomVoid/cpp-merge.git
2026
```
2127

2228
##### Build and link package
29+
2330
Using npm:
31+
2432
```
2533
npm install
2634
npm run build
2735
npm link
2836
```
2937

3038
Or using yarn:
39+
3140
```
3241
yarn
3342
yarn build
3443
yarn link
3544
```
3645

3746
## Usage
38-
This tool will produce single source file from multiple C/C++ files. By default produced content is displayed on
39-
the standard output. To save it into a file use option `-o` or `--output`.
4047

41-
File passed as an argument will be processed similarly to what preprocessor would do. It means all included local
42-
files (ex. `#include "header.hpp"`) will processed and added to output in place of the include directive.
43-
Program will search for include files first in directory where currently processed file is located and then in
48+
This tool will produce a single source file from multiple C/C++ files. By default produced content is displayed on the
49+
standard output. To save it into a file use option `-o` or `--output`.
50+
51+
File passed as an argument will be processed similarly to what the preprocessor would do. It means all included local
52+
files (ex. `#include "header.hpp"`) will be processed and added to output in place of the include directive. Program
53+
will search for include files first in the directory where the currently processed file is located and then in
4454
additional include directory, if it was specified in program arguments (option `-i` or `--include`).
4555

4656
Files containing `#pragma once` will be processed only once, so use this directive to avoid duplication of content of
4757
files in the output and to reduce its size.
4858

49-
After processing all included files, program will try to find related source file for each of included local header
50-
files. If file with same base name and extension .c or .cpp exists, it will be appended to the output. Program will
51-
search first in the same directory where main source file is located and then in additional source directory, if it was
52-
specified in program arguments (option `-s` or `--source`). If the header was included using relative path ex.
53-
`#include "one/two/three.hpp"` the program will search for `three.c` or `three.cpp` in `one/two/` or
54-
`${sourceDirectory}/one/two/`. First found file will be appended to the output.
59+
After processing all included files, the program will try to find related source files for each of included local header
60+
files. If a file with the same base name and extension .c or .cpp exists, it will be appended to the output. Program
61+
will search first in the same directory where the main source file is located and then in an additional source
62+
directory, if it was specified in program arguments (option `-s` or `--source`). If the header was included using
63+
relative path ex. `#include "one/two/three.hpp"` the program will search for `three.c` or `three.cpp` in `one/two/`
64+
or `${sourceDirectory}/one/two/`. First found file will be appended to the output.
5565

56-
Program will detect duplication of system header includes, so output will contain only unique set of them, ordered
57-
alphabetically. Any of processed header and source files will not be changed.
66+
Program will detect duplication of system header includes, so output will contain only a unique set of them, ordered
67+
alphabetically. Any of the processed header and source files will not be changed.
68+
69+
Display the build-in help:
5870

59-
Display build-in help:
6071
```
6172
cpp-merge --help
6273
```
6374

6475
#### Usage examples
65-
Process `main.cpp` and display produced content on standard output:
76+
77+
Process `main.cpp` and display produced content on the standard output:
78+
6679
```
6780
cpp-merge main.cpp
6881
```
6982

7083
Process `main.cpp` and save output to file `output.cpp`:
84+
7185
```
7286
cpp-merge --output output.cpp main.cpp
7387
```
7488

7589
Specify additional include and source directory:
90+
7691
```
7792
cpp-merge --include ../include --source ../src main.cpp
78-
```
93+
```

0 commit comments

Comments
 (0)