aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/command_line_interface.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/compiler/command_line_interface.cc')
-rw-r--r--src/google/protobuf/compiler/command_line_interface.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc
index afe63a77..0ef8c0d8 100644
--- a/src/google/protobuf/compiler/command_line_interface.cc
+++ b/src/google/protobuf/compiler/command_line_interface.cc
@@ -1182,6 +1182,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;