Commit 3b227611 authored by Dennis Cappendijk's avatar Dennis Cappendijk

show help if protoc is called without any arguments, pre-empts -h and --help to…

show help if protoc is called without any arguments, pre-empts -h and --help to show a useful message instead of just 'Missing input file.'
parent 85466206
......@@ -1012,6 +1012,12 @@ CommandLineInterface::ParseArguments(int argc, const char* const argv[]) {
arguments.push_back(argv[i]);
}
// if no arguments are given, show help
if(arguments.empty()) {
PrintHelpText();
return PARSE_ARGUMENT_DONE_AND_EXIT; // Exit without running compiler.
}
// Iterate through all arguments and parse them.
for (int i = 0; i < arguments.size(); ++i) {
string name, value;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment