Forgot print_usage() on invalid option.

master
DJ Lucas 2017-12-05 22:40:57 -06:00
parent 0c70f7ee36
commit 221edee07c
1 changed files with 5 additions and 2 deletions

View File

@ -32,8 +32,7 @@
void print_usage()
{
printf("examplar [ -h/--help ] [ -v/--verbose ] [ -c/--config CONFIG_PATH ]\n\n");
exit(0);
printf("examplar [ -h | --help ] [ -v | --verbose ] [ -c | --config CONFIG_PATH ]\n\n");
}
int main( int argc, char * argv[] )
@ -78,6 +77,9 @@ int main( int argc, char * argv[] )
case 'c':
config_path = std::string(optarg);
break;
case '?':
print_usage();
exit(1);
default:
break;
}
@ -86,6 +88,7 @@ int main( int argc, char * argv[] )
if ( show_help == true )
{
print_usage();
exit(0);
}
setlogmask( LOG_UPTO( LOG_INFO ) );