X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=grab_client.c;h=2dfb295b8ce87fcb5f165bcfd4b3c25f3bdb5b50;hp=2a98b35f8831210280321cbb3a48ff984996dd65;hb=e2213f2468eb1c6f8ca033c6529ee1b5ceadab7f;hpb=4b4c68de8d7390f966e46d9402d5499d2e8ee227 diff --git a/grab_client.c b/grab_client.c index 2a98b35f..2dfb295b 100644 --- a/grab_client.c +++ b/grab_client.c @@ -33,15 +33,6 @@ #include "error.h" #include "string.h" - -/** this maps the enum to the text used at the command line */ -static const char *gc_modes[] = { - [GRAB_PEDANTIC] = "pedantic", - [GRAB_SLOPPY] = "sloppy", - [GRAB_AGGRESSIVE] = "aggressive", - NULL -}; - /** grab clients that are not yet attached to a filter node */ struct list_head inactive_grab_client_list; @@ -99,13 +90,12 @@ static int check_gc_args(struct grab_client *gc) { int i; struct grab_client_args_info *conf = gc->conf; + char **mv = grab_client_cmdline_parser_mode_values; PARA_INFO_LOG("filter_num: %d\n", gc->conf->filter_num_arg); - for (i = 0; gc_modes[i]; i++) - if (!strcmp(conf->mode_arg, gc_modes[i])) + for (i = 0; mv[i]; i++) + if (!strcmp(conf->mode_arg, mv[i])) break; - if (!gc_modes[i]) - return -E_INVALID_GRAB_MODE; gc->mode = i; if (conf->audio_format_given) { gc->audio_format_num = get_audio_format_num(conf->audio_format_arg); @@ -263,6 +253,9 @@ __malloc struct grab_client *grab_client_new(int fd, int argc, char **argv, int *err = -E_GC_HELP_GIVEN; if (gc->conf->help_given) goto err_out; + *err = -E_GC_VERSION_GIVEN; + if (gc->conf->version_given) + goto err_out; *err = check_gc_args(gc); if (*err < 0) goto err_out;