mirror of
https://github.com/MaskRay/ccls.git
synced 2025-02-22 00:19:28 +00:00
Check --init and remove --wait-for-input
This commit is contained in:
parent
1e7727f75a
commit
640d72f85c
@ -100,7 +100,6 @@ Other command line options:
|
|||||||
Print stdin (requests) and stdout (responses) to stderr
|
Print stdin (requests) and stdout (responses) to stderr
|
||||||
--log-file <path> Logging file for diagnostics
|
--log-file <path> Logging file for diagnostics
|
||||||
--log-all-to-stderr Write all log messages to STDERR.
|
--log-all-to-stderr Write all log messages to STDERR.
|
||||||
--wait-for-input Wait for an '[Enter]' before exiting
|
|
||||||
--help Print this help information.
|
--help Print this help information.
|
||||||
--ci Prevents tests from prompting the user for input. Used for
|
--ci Prevents tests from prompting the user for input. Used for
|
||||||
continuous integration so it can fail faster instead of timing
|
continuous integration so it can fail faster instead of timing
|
||||||
@ -502,8 +501,14 @@ int main(int argc, char** argv) {
|
|||||||
<< ")\n";
|
<< ")\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (!reader.IsObject()) {
|
JsonReader json_reader{&reader};
|
||||||
std::cerr << "--init must be a JSON object\n";
|
try {
|
||||||
|
Config config;
|
||||||
|
Reflect(json_reader, config);
|
||||||
|
} catch (std::invalid_argument& e) {
|
||||||
|
std::cerr << "Fail to parse --init "
|
||||||
|
<< static_cast<JsonReader&>(json_reader).GetPath()
|
||||||
|
<< ", expected " << e.what() << "\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -514,10 +519,5 @@ int main(int argc, char** argv) {
|
|||||||
&stdout_waiter);
|
&stdout_waiter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasOption(options, "--wait-for-input")) {
|
|
||||||
std::cerr << std::endl << "[Enter] to exit" << std::endl;
|
|
||||||
getchar();
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
// TODO Cleanup global variables
|
// TODO Cleanup global variables
|
||||||
extern std::string g_init_options;
|
extern std::string g_init_options;
|
||||||
extern bool g_index_builtin_types;
|
|
||||||
extern int g_enable_comments;
|
extern int g_enable_comments;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
Loading…
Reference in New Issue
Block a user