From ad020e84ddf41a9d26545bc961df2204ea107a63 Mon Sep 17 00:00:00 2001 From: Charles Gould Date: Mon, 4 May 2020 15:53:50 -0500 Subject: [PATCH] Exit key reader normally on help, version --- src/fish_indent.cpp | 2 +- src/fish_key_reader.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/fish_indent.cpp b/src/fish_indent.cpp index fa4b79ae6..d1285dd7d 100644 --- a/src/fish_indent.cpp +++ b/src/fish_indent.cpp @@ -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': { diff --git a/src/fish_key_reader.cpp b/src/fish_key_reader.cpp index 2ecaa5756..4521621e4 100644 --- a/src/fish_key_reader.cpp +++ b/src/fish_key_reader.cpp @@ -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.