mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
Improve split script (#1011)
- Added shebang and made the script executable. - Added help text. - Added -o/--out argument for specifying output directory. - Added -e/--extension argument for specifying file extension of the implementation file. - Made the script find httplib.h next to split.py instead of the current working directory. This makes it possible to call the script from another directory. - Simplified code structure slightly. - Improved variable naming to follow Python conventions.
This commit is contained in:
parent
ccbddd8842
commit
6f7075e3aa
2 changed files with 54 additions and 29 deletions
18
README.md
18
README.md
|
@ -749,10 +749,20 @@ res->body; // Compressed data
|
|||
Split httplib.h into .h and .cc
|
||||
-------------------------------
|
||||
|
||||
```bash
|
||||
> python3 split.py
|
||||
> ls out
|
||||
httplib.h httplib.cc
|
||||
```console
|
||||
$ ./split.py -h
|
||||
usage: split.py [-h] [-e EXTENSION] [-o OUT]
|
||||
|
||||
This script splits httplib.h into .h and .cc parts.
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-e EXTENSION, --extension EXTENSION
|
||||
extension of the implementation file (default: cc)
|
||||
-o OUT, --out OUT where to write the files (default: out)
|
||||
|
||||
$ ./split.py
|
||||
Wrote out/httplib.h and out/httplib.cc
|
||||
```
|
||||
|
||||
NOTE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue