Add --wait-for-input.

Previous on Windows when running index tests cquery would wait for the user to
press enter. This breaks AppVeyor CI.
This commit is contained in:
Jacob Dufault 2017-12-23 14:52:46 -08:00
parent b69e32a749
commit 2bc44d59f2

View File

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