Skip to content

Commit

Permalink
Training tools: Print help message when (argv == 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
amitdo committed May 22, 2016
1 parent 7ffa2a0 commit cd1a144
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions training/commandlineflags.cpp
Expand Up @@ -144,6 +144,12 @@ void PrintCommandLineFlags() {
void ParseCommandLineFlags(const char* usage,
int* argc, char*** argv,
const bool remove_flags) {
if (*argc == 1) {
tprintf("USAGE: %s\n", usage);
PrintCommandLineFlags();
exit(0);
}

unsigned int i = 1;
for (i = 1; i < *argc; ++i) {
const char* current_arg = (*argv)[i];
Expand Down

0 comments on commit cd1a144

Please sign in to comment.