Merge cpp codes into single sources file.
npm install venus-acm
venus-acm
alt="Npm Version"
src="https://img.shields.io/npm/v/venus-acm.svg"
/>
alt="Npm Download"
src="https://img.shields.io/npm/dm/venus-acm.svg"
/>
alt="Npm License"
src="https://img.shields.io/npm/l/venus-acm.svg"
/>
alt="Node.js Version"
src="https://img.shields.io/node/v/venus-acm"
/>
alt="Tested with Jest"
src="https://img.shields.io/badge/tested_with-jest-9c465e.svg"
/>
alt="Code Style: prettier"
src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square"
/>
In ACM competitions or when writing algorithmic questions, usually only a single
file can be submitted to the online judgment system. But there are many mature
algorithms or data structures that can be used as black-box code (such as
Binary Search Tree), so you can maintain your own code base and import local
algorithm codes through the -I option of the g++ compiler.
The goal of this project is to parse the cpp source code and replace the source
code of the local cpp source files with the corresponding #include macro
declarations.
* npm
``bash`
npm install -g venus-acm
* yarn
`bash`
yarn global add venus-acm
`bash
$ venus --help
Usage: venus-acm [options] [command]
Options:
-V, --version output the version number
--log-level
--log-name
--log-mode <'normal' | 'loose'> specify logger's name.
--log-flag
Commands:
generate|g [options]
help [command] display help for command
`
* Overview
`bash
$ venus init --help
Usage: venus-acm init|i [options]
Options:
--plop-bypass
-h, --help display help for command
`
- Arguments
- : location of the cpp project root dir.
* Example
`bash`
$ venus init acm-cpp
Then, a directory named acm-cpp with structure like below will be created:
`bash`
acm-cpp
├── .vscode
│ └── settings.jsonp
├── oj
│ └── fake
│ └── 01.cpp
├── script
│ └── run.js
├── src
│ └── @guanghechen
│ └── algorithm
│ └── match-first.hpp
├── .clang-format
├── .editorconfig
├── .eslintignore
├── .eslintrc
├── .gitignore
├── .prettierignore
├── .prettierrc
├── CMakeLists.txt
└── package.json
`bash
$ venus generate --help
Usage: venus-acm generate|g [options]
Options:
--remove-comments remove comments
--no-remove-comments
--remove-spaces remove spaces
--no-remove-spaces
--remove-freopen remove freopen statements
--no-remove-freopen
--remove-assert remove assert statements
--no-remove-assert
-u, --uglify shortcut of --rc --rs.
--no-uglify
-c, --copy write generated code into system clipboard
--no-copy
-f, --force force write the generated code into output filepath
--no-force
-I, --include
-o, --output
* Arguments
- : The entry filepath of cpp source codes.[output filepath]
- : The output filepath that the generated codes writes to.
* Options
* Example
`bash`
venus generate oj/fake/01.cpp --output venus.cpp --copy
Then, the generated code will be copied to the system clipboard and saved into
venus.cpp`.