From 2bc44d59f2e3d06990ec49538c14caea713fb225 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Sat, 23 Dec 2017 14:52:46 -0800 Subject: [PATCH] Add --wait-for-input. Previous on Windows when running index tests cquery would wait for the user to press enter. This breaks AppVeyor CI. --- src/command_line.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/command_line.cc b/src/command_line.cc index f05a30be..624760a6 100644 --- a/src/command_line.cc +++ b/src/command_line.cc @@ -1036,10 +1036,6 @@ int main(int argc, char** argv) { if (HasOption(options, "--test-index")) { print_help = false; RunIndexTests(options["--test-index"]); -#if defined(_WIN32) - std::cerr << std::endl << "[Enter] to exit" << std::endl; - std::cin.get(); -#endif } if (HasOption(options, "--language-server")) { @@ -1050,6 +1046,11 @@ int main(int argc, char** argv) { return 0; } + if (HasOption(options, "--wait-for-input")) { + std::cerr << std::endl << "[Enter] to exit" << std::endl; + std::cin.get(); + } + if (print_help) { std::cout << R"help(cquery is a low-latency C/C++/Objective-C language server. @@ -1075,6 +1076,9 @@ Command line options: --clang-sanity-check Run a simple index test. Verifies basic clang functionality. Needs to be executed from the cquery root checkout directory. + --wait-for-input + If true, cquery will wait for an '[Enter]' before exiting. + Useful on windows. --help Print this help information. Configuration: