print usage if input or output is not set

This commit is contained in:
j 2013-07-24 13:37:25 +02:00
parent ff5de3a375
commit d47b90be39

View file

@ -67,7 +67,7 @@ typedef struct _oxstate {
static void usage(void){ static void usage(void){
fprintf(stderr, fprintf(stderr,
"Usage: oxframe [options]\n\n" "Usage: oxframe -i <input> -o <output> [options]\n\n"
"Options: \n\n" "Options: \n\n"
" -h, --help show this help message and exit\n" " -h, --help show this help message and exit\n"
" -x WIDTH, --width=WIDTH\n" " -x WIDTH, --width=WIDTH\n"
@ -538,7 +538,7 @@ int main (int argc, char * argv[]) {
} }
} }
if(argc < 3) { if(argc < 3 || state.input == NULL || state.output == NULL) {
usage(); usage();
} }