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:
2026-03-20 13:01:38 -04:00
parent d4fa557c64
commit 4a692c08f4

View File

@@ -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 {