" -r, --recurse Recurse into sub-directories (default=off)",
"\nOPTIONS:",
" -v, --verbose=INT Verbosity level (default=`1')",
+ " -D, --debug=INT Debug messages level (default=`0')",
0
};
args_info->dir_given = 0 ;
args_info->recurse_given = 0 ;
args_info->verbose_given = 0 ;
+ args_info->debug_given = 0 ;
}
static
args_info->recurse_flag = 0;
args_info->verbose_arg = 1;
args_info->verbose_orig = NULL;
+ args_info->debug_arg = 0;
+ args_info->debug_orig = NULL;
}
args_info->dir_help = gengetopt_args_info_help[5] ;
args_info->recurse_help = gengetopt_args_info_help[6] ;
args_info->verbose_help = gengetopt_args_info_help[8] ;
+ args_info->debug_help = gengetopt_args_info_help[9] ;
}
free_string_field (&(args_info->dir_arg));
free_string_field (&(args_info->dir_orig));
free_string_field (&(args_info->verbose_orig));
+ free_string_field (&(args_info->debug_orig));
for (i = 0; i < args_info->inputs_num; ++i)
write_into_file(outfile, "recurse", 0, 0 );
if (args_info->verbose_given)
write_into_file(outfile, "verbose", args_info->verbose_orig, 0);
+ if (args_info->debug_given)
+ write_into_file(outfile, "debug", args_info->debug_orig, 0);
i = EXIT_SUCCESS;
{ "dir", 1, NULL, 'd' },
{ "recurse", 0, NULL, 'r' },
{ "verbose", 1, NULL, 'v' },
+ { "debug", 1, NULL, 'D' },
{ NULL, 0, NULL, 0 }
};
- c = getopt_long (argc, argv, "hVpf:d:rv:", long_options, &option_index);
+ c = getopt_long (argc, argv, "hVpf:d:rv:D:", long_options, &option_index);
if (c == -1) break; /* Exit from `while (1)' loop. */
goto failure;
break;
+ case 'D': /* Debug messages level. */
+
+
+ if (update_arg( (void *)&(args_info->debug_arg),
+ &(args_info->debug_orig), &(args_info->debug_given),
+ &(local_args_info.debug_given), optarg, 0, "0", ARG_INT,
+ check_ambiguity, override, 0, 0,
+ "debug", 'D',
+ additional_error))
+ goto failure;
+
+ break;
case 0: /* Long option with no short option */
case '?': /* Invalid option. */