A small cli tool for C++ project management.
- Create a C++ project. Includes: src folder, build folder, Makefile, Main.cpp
- Generate new class files. Updates Makefile to include new files.
- Remove class files. Updates Makefile to not include removed files.
- Build project to generate an executable.
- Run command will build and run the project.
- Adding data members to class with specified type.
- Generate setters and getters for data members in class
To setup this file for global use create a directory called cpproj in a place that won't get changed. Place the cpproj.rb script in the cpproj directory. Go to the file that holds your paths (on Mac it would be .bash_profile) and add this line: "alias cpproj='ruby /pathToDirectory/cpproj/cpproj.rb' " And thats it! You will be set to use this globally throughout your system.
*If you haven't setup this file globally then you will have to call on the script like so: ruby /path/to/cpproj.rb
-
Initialize a project
cpproj init my_project
This will create a folder called my_project. Directly inside the is a Makefile and build and src folders. Inside src folder there is a Main.cpp file. -
Create a class
cpproj create_class ClassName
This will generate simple .cpp and .hpp files within the src folder with defualt constructor and destructor created for you. This will also update the Makefile to include the new class in compilation. -
Remove a class
cpproj remove_class ClassName
This will remove the class specified from the project and Makefile. -
Build project
cpproj build
This will clean out previous executable and object files and only build project. -
Run project
cpproj run
This will execute build command and then run the exectuable afterwards. -
Help
cpproj help
If you need to have a reminder of all of the commands this will list them and give a brief description of it's functionality.