Skip to content

Commit aafb1a2

Browse files
committed
fix: return 0 for --help/--version instead of crashing
std::monostate is triggered when only flags like --help or --version are passed (no subcommand). __builtin_unreachable() caused a coredump because this path was actually reachable. Signed-off-by: Yuming He <ComixHe1895@outlook.com>
1 parent fc2a53c commit aafb1a2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/linyaps_box/app.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ try {
5959
return command::run(options);
6060
},
6161
[](const std::monostate &) -> int {
62-
__builtin_unreachable();
62+
return 0;
6363
} },
6464
opts.subcommand_opt);
6565
} catch (const std::exception &e) {

0 commit comments

Comments
 (0)