New --version-machine CLI command
This commit is contained in:
@@ -287,6 +287,21 @@ namespace Bloom
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int Application::presentVersionMachineText() {
|
||||
Logger::silence();
|
||||
|
||||
std::cout << QJsonDocument(QJsonObject({
|
||||
{"version", QString::fromStdString(Application::VERSION.toString())},
|
||||
{"components", QJsonObject({
|
||||
{"major", Application::VERSION.getMajor()},
|
||||
{"minor", Application::VERSION.getMinor()},
|
||||
{"patch", Application::VERSION.getPatch()},
|
||||
})},
|
||||
})).toJson().toStdString();
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int Application::initProject() {
|
||||
auto configFile = QFile(
|
||||
QString::fromStdString(std::filesystem::current_path().string() + "/bloom.json")
|
||||
|
||||
@@ -156,6 +156,10 @@ namespace Bloom
|
||||
"-v",
|
||||
std::bind(&Application::presentVersionText, this)
|
||||
},
|
||||
{
|
||||
"--version-machine",
|
||||
std::bind(&Application::presentVersionMachineText, this)
|
||||
},
|
||||
{
|
||||
"init",
|
||||
std::bind(&Application::initProject, this)
|
||||
@@ -210,6 +214,13 @@ namespace Bloom
|
||||
*/
|
||||
int presentVersionText();
|
||||
|
||||
/**
|
||||
* Presents the current Bloom version number, in JSON format.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
int presentVersionMachineText();
|
||||
|
||||
/**
|
||||
* Initialises a project in the user's working directory.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user