Initialise your C++ projects easily with cinitpp!
Copyright © 2023-2024 Contributors
This project is licensed under the Apache license. View LICENSE for more details.
JSON config format:
[
{
"config": "configName",
"items": [
{"path": "path/to/file.txt", "contents": "contents"},
// Directories will terminate with a '/'; content will be ignored.
{"path": "path/to/dir/", "contents": ""}
// Other files and dirs
]
}
// Other configs
]
cinitpp [-I | --input] <path> [-g | --global] [-f | --force] [-c | --config [identifier]]
To initialise, use the following command:
cinitpp
To force an initialisation even when the current directory is not empty, use the flag -f, --force
Using the flag -c, --config
will read the specific configuration within the config file.
cinitpp -c <CONFIG IDENTIFIER>
Note, the config name must follow immediately after the flag. When not specified, the configuration Default
will be read from.
Using the flag -g, --global
will read the configuration that's effective globally.
cinitpp -G
By default, cinitpp will search for the local config, (i.e., the configuration located in the home directory) followed by the global config. If none of those are available, it will use the default initialisation data:
./
├───include/
├───src/
│ └───main.cpp
│ "int main() {}"
│
├───README.md
│ ""
└───CMakeLists.txt
""
To generate a config file, use the flag -I, --input
cinitpp -I <INPUT DIRECTORY>
Note, the input directory must follow immediately after the flag -I, --input
.
The config file will be created at your home directory by default.
To create a config file that's effective globally, include the flag -g, --global
.
cinitpp -G -I <INPUT DIRECTORY>
To add a configuration with a unique identifier to the config file, use the flag -c, --config
. If it already exists, the previous configuration associated with that identifier will be overwritten.
cinitpp -I <INPUT DIRECTORY> -c <CONFIG IDENTIFIER>
If a configuration identifier is not provided, the configuration Default
will be created or overwritten.
Using config file -f, --force
will suppress all non-error messages (e.g., Wrote configuration to ~/.cinitpp.json
)
Due to my inability to give a shit and std::filesystem's substandard design choices, Windows configurations will not be compatible with linux.
- nlohmann/json 3.11.0
- Add a way to add files to config directly (via cinitpp)
- Add a way to delete configs directly
- Add a way to delete files from config directly
- Add -v
- ? Use a faster json library