Merge pull request #3117 from KarrokDC/master

Show help if protoc is called without any arguments
pull/3130/head
Feng Xiao 8 years ago committed by GitHub
commit c5125f371d
  1. 6
      src/google/protobuf/compiler/command_line_interface.cc

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

Loading…
Cancel
Save