Exit key reader normally on help, version

This commit is contained in:
Charles Gould 2020-05-04 15:53:50 -05:00 committed by David Adam
parent bd472ececc
commit ad020e84dd
2 changed files with 5 additions and 6 deletions

View file

@ -575,7 +575,7 @@ int main(int argc, char *argv[]) {
exit(0);
}
case 'v': {
std::fwprintf(stderr, _(L"%ls, version %s\n"), program_name, get_fish_version());
std::fwprintf(stdout, _(L"%ls, version %s\n"), program_name, get_fish_version());
exit(0);
}
case 'w': {

View file

@ -284,13 +284,12 @@ static bool parse_flags(int argc, char **argv, bool *continuous_mode) {
break;
}
case 'h': {
print_help("fish_key_reader", 0);
error = true;
break;
print_help("fish_key_reader", 1);
exit(0);
}
case 'v': {
std::fwprintf(stdout, L"%s\n", get_fish_version());
return false;
std::fwprintf(stdout, _(L"%ls, version %s\n"), program_name, get_fish_version());
exit(0);
}
default: {
// We assume getopt_long() has already emitted a diagnostic msg.