Training tools: Print help message when (argv == 1)

This commit is contained in:
amitdo 2016-05-22 11:16:42 +03:00
parent 7ffa2a01c2
commit cd1a14450c

View File

@ -144,6 +144,12 @@ void PrintCommandLineFlags() {
void ParseCommandLineFlags(const char* usage, void ParseCommandLineFlags(const char* usage,
int* argc, char*** argv, int* argc, char*** argv,
const bool remove_flags) { const bool remove_flags) {
if (*argc == 1) {
tprintf("USAGE: %s\n", usage);
PrintCommandLineFlags();
exit(0);
}
unsigned int i = 1; unsigned int i = 1;
for (i = 1; i < *argc; ++i) { for (i = 1; i < *argc; ++i) {
const char* current_arg = (*argv)[i]; const char* current_arg = (*argv)[i];