fix(stroid): exit properly after stroid -v
previously calling stroid -v would print the version but then continue on the default run case, now both -v and -d result in an immediate exit after their tasks are done
This commit is contained in:
@@ -112,11 +112,13 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
info->add_flag_callback("-v,--version", []() {
|
info->add_flag_callback("-v,--version", []() {
|
||||||
std::println("Stroid Version {}", stroid::version::toString());
|
std::println("Stroid Version {}", stroid::version::toString());
|
||||||
|
exit(0);
|
||||||
}, "Display stroid version information");
|
}, "Display stroid version information");
|
||||||
|
|
||||||
info->add_flag_callback("-d,--default", [&cfg]() {
|
info->add_flag_callback("-d,--default", [&cfg]() {
|
||||||
cfg.save("default.toml");
|
cfg.save("default.toml");
|
||||||
std::println("Default configuration saved to default.toml");
|
std::println("Default configuration saved to default.toml");
|
||||||
|
exit(0);
|
||||||
}, "Save the default configuration to default.toml");
|
}, "Save the default configuration to default.toml");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user