Skip to content

Commit

Permalink
Added custom options error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
iliya-gr committed Aug 15, 2012
1 parent 0fb1772 commit e70e6b6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mediasegmenter.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ int main(int argc, char **argv) {
int ret;
int option_index = 0;

opterr = 0;

int c;
do{
Expand Down Expand Up @@ -649,7 +650,11 @@ int main(int argc, char **argv) {
case 'e': config.type = HLSTypeEvent; break;
case 'w': config.max_index_entries = atoi(optarg); break;
case 'D': config.delete = 1; break;


case '?':
fprintf(stderr ,"%s: invalid option '%s'\n", argv[0], argv[optind - 1]);
exit(EXIT_FAILURE);
break;
}
} while (c!= -1);

Expand Down

0 comments on commit e70e6b6

Please sign in to comment.