Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aashishpanchal/cpm
cpm is command line tool, it's use to create c++ project and manage
https://github.com/aashishpanchal/cpm
Last synced: 6 days ago
JSON representation
cpm is command line tool, it's use to create c++ project and manage
- Host: GitHub
- URL: https://github.com/aashishpanchal/cpm
- Owner: aashishpanchal
- License: mit
- Created: 2021-12-22T07:46:53.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-22T15:56:39.000Z (almost 3 years ago)
- Last Synced: 2023-12-26T15:57:41.999Z (11 months ago)
- Language: Python
- Size: 18.6 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CPM / C++ Project Manager.
CPM is a high-level Python Command Line Program.
#### Still in a buggy alpha state.## CPM using required
Python interpreter and Mingw g++/gcc complier
```bash
python version 3.8 < 3.10
```
## CPM InstallationInstall cpm with pip
```bash
pip install cpp-projects-manager-cli
```
## create c++ project with CPM
```bash
python -m cpm init !directory is Optional
```
```cmd
_____ _____ __ __
/ ____| | __ \ | \/ |
| | | |__) | | \ / |
| | | ___/ | |\/| |
| |____ | | | | | |
\_____| |_| |_| |_|
welcome to cpm
project author: example
project description: demo
project entry point(main.cpp):
successfully create your example project
```
#### cpm.json
```json
{
"name": "example",
"version": "1.0.0",
"author": "example",
"description": "demo",
"entry_point": "main.cpp"
}
```
## run project
```base
python -m cpm run !Optional
```
## How to add C++ App in project
First create c++ app
### create app
```bash
python -m cpm makeapp !directory is Optional
```
```bash
$~ python -m cpm makeapp test
$~ successfully create your test app
```
## app add in cpm.json
open cpm.json file in any text editor. and add c++ app
```json
{
....
"apps": [
{
"name": "test"
}
]
}
```
again run your project with app
```base
$~ > python -m cpm run
[ build ] --- test --- [ D:\......\test.a ] 0.174ms
combine compile main.cpp
compile successfully. 0.617ms
Hello World!
```
## Run new terminal
```base
$~ > python -m cpm run --new-terminal
[ build ] --- test --- [ D:\......\test.a ] 0.174ms
combine compile main.cpp
compile successfully. 0.617ms
Hello World!
```## Custom Command
make folder and file on current work dir:
```
|- extra_commands
| |
|----- __init__.py
|----- commands
| |
|--------- __init__.py
|--------- example.py
|- test
|- cpm.json
|- main.cpp
```
#### example.py
```python.py
from cpm.core.base import BaseCommandclass Command(BaseCommand):
"""
Example command
"""
help = 'Example command'
description = 'Example command'
def add_arguments(self, parser):
parser.add_argument('--example', action='store_true', help='Example argument')def handle(self, *args, **options):
print('Example command', options)
```
#### check custom command
```base
$~ python -m cpm --helpType 'python -m cpm help ' for help on a specific subcommand.
Available subcommands:
Commands:
example Example command
init Creates a c++ project.
makeapp Creates a c++ app.
run Runs c++ project.
```
#### run custom command
```base
$~ python -m cpm example
Example command {'traceback': False, 'example': False}
```
#### Command help
```base
$~ python -m cpm example --help
usage: __main__.py example [--example] [-h] [-v] [--traceback]Example command
optional arguments:
--example Example argument
-h, --help show this help message and exit
-v, --version Show program's version number and exit.
--traceback Raise on CommandError exceptions.
```