mirror of
https://github.com/MaskRay/ccls.git
synced 2025-02-21 07:59:27 +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
|
||||
--log-file <path> Logging file for diagnostics
|
||||
--log-all-to-stderr Write all log messages to STDERR.
|
||||
--wait-for-input Wait for an '[Enter]' before exiting
|
||||
--help Print this help information.
|
||||
--ci Prevents tests from prompting the user for input. Used for
|
||||
continuous integration so it can fail faster instead of timing
|
||||
@ -502,8 +501,14 @@ int main(int argc, char** argv) {
|
||||
<< ")\n";
|
||||
return 1;
|
||||
}
|
||||
if (!reader.IsObject()) {
|
||||
std::cerr << "--init must be a JSON object\n";
|
||||
JsonReader json_reader{&reader};
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -514,10 +519,5 @@ int main(int argc, char** argv) {
|
||||
&stdout_waiter);
|
||||
}
|
||||
|
||||
if (HasOption(options, "--wait-for-input")) {
|
||||
std::cerr << std::endl << "[Enter] to exit" << std::endl;
|
||||
getchar();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
// TODO Cleanup global variables
|
||||
extern std::string g_init_options;
|
||||
extern bool g_index_builtin_types;
|
||||
extern int g_enable_comments;
|
||||
|
||||
namespace {
|
||||
|
Loading…
Reference in New Issue
Block a user