--- trunk/src/applications/dynamicProps/DynamicPropsCmd.c 2007/10/02 12:05:25 1183 +++ trunk/src/applications/dynamicProps/DynamicPropsCmd.c 2008/01/23 21:21:50 1213 @@ -1,5 +1,5 @@ /* - File autogenerated by gengetopt version 2.16 + File autogenerated by gengetopt version 2.19.1 generated with the following command: gengetopt -F DynamicPropsCmd @@ -21,6 +21,31 @@ #include "DynamicPropsCmd.h" +const char *gengetopt_args_info_purpose = ""; + +const char *gengetopt_args_info_usage = "Usage: DynamicProps [OPTIONS]..."; + +const char *gengetopt_args_info_description = ""; + +const char *gengetopt_args_info_help[] = { + " -h, --help Print help and exit", + " -V, --version Print version and exit", + " -i, --input=filename input dump file", + " -o, --output=filename output file name", + " --sele1=selection script select first stuntdouble set", + " --sele2=selection script select second stuntdouble set (if sele2 is not \n set, use script from sele1)", + " --order=INT Lengendre Polynomial Order", + "\n Group: dynamicProps\n an option of this group is required", + " -r, --rcorr rmsd", + " -v, --vcorr velocity correlation function", + " -d, --dcorr dipole correlation function", + " -l, --lcorr Lengendre correlation function", + " --r_rcorr Radial rmsd", + " --thetacorr Angular rmsd", + " --drcorr Directional rmsd for particles with unit \n vectors", + 0 +}; + static void clear_given (struct gengetopt_args_info *args_info); static @@ -51,7 +76,6 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->lcorr_given = 0 ; args_info->r_rcorr_given = 0 ; args_info->thetacorr_given = 0 ; - args_info->actioncorr_given = 0 ; args_info->drcorr_given = 0 ; args_info->dynamicProps_group_counter = 0 ; } @@ -71,6 +95,26 @@ void clear_args (struct gengetopt_args_info *args_info } +static +void init_args_info(struct gengetopt_args_info *args_info) +{ + args_info->help_help = gengetopt_args_info_help[0] ; + args_info->version_help = gengetopt_args_info_help[1] ; + args_info->input_help = gengetopt_args_info_help[2] ; + args_info->output_help = gengetopt_args_info_help[3] ; + args_info->sele1_help = gengetopt_args_info_help[4] ; + args_info->sele2_help = gengetopt_args_info_help[5] ; + args_info->order_help = gengetopt_args_info_help[6] ; + args_info->rcorr_help = gengetopt_args_info_help[7] ; + args_info->vcorr_help = gengetopt_args_info_help[8] ; + args_info->dcorr_help = gengetopt_args_info_help[9] ; + args_info->lcorr_help = gengetopt_args_info_help[10] ; + args_info->r_rcorr_help = gengetopt_args_info_help[11] ; + args_info->thetacorr_help = gengetopt_args_info_help[12] ; + args_info->drcorr_help = gengetopt_args_info_help[13] ; + +} + void cmdline_parser_print_version (void) { @@ -80,25 +124,19 @@ cmdline_parser_print_help (void) void cmdline_parser_print_help (void) { + int i = 0; cmdline_parser_print_version (); - printf("\nUsage: DynamicProps [OPTIONS]...\n\n"); - printf("%s\n"," -h, --help Print help and exit"); - printf("%s\n"," -V, --version Print version and exit"); - printf("%s\n"," -i, --input=filename input dump file"); - printf("%s\n"," -o, --output=filename output file name"); - printf("%s\n"," --sele1=selection script select first stuntdouble set"); - printf("%s\n"," --sele2=selection script select second stuntdouble set (if sele2 is not \n set, use script from sele1)"); - printf("%s\n"," --order=INT Lengendre Polynomial Order"); - printf("%s\n","\n Group: dynamicProps\n an option of this group is required"); - printf("%s\n"," -r, --rcorr rmsd"); - printf("%s\n"," -v, --vcorr velocity correlation function"); - printf("%s\n"," -d, --dcorr dipole correlation function"); - printf("%s\n"," -l, --lcorr Lengendre correlation function"); - printf("%s\n"," --r_rcorr Radial rmsd"); - printf("%s\n"," --thetacorr Angular rmsd"); - printf("%s\n"," --actioncorr Action correlation function"); - printf("%s\n"," --drcorr Directional rmsd for particles with unit \n vectors"); - + + if (strlen(gengetopt_args_info_purpose) > 0) + printf("\n%s\n", gengetopt_args_info_purpose); + + printf("\n%s\n\n", gengetopt_args_info_usage); + + if (strlen(gengetopt_args_info_description) > 0) + printf("%s\n", gengetopt_args_info_description); + + while (gengetopt_args_info_help[i]) + printf("%s\n", gengetopt_args_info_help[i++]); } void @@ -106,6 +144,7 @@ cmdline_parser_init (struct gengetopt_args_info *args_ { clear_given (args_info); clear_args (args_info); + init_args_info (args_info); } static void @@ -234,9 +273,6 @@ cmdline_parser_file_save(const char *filename, struct if (args_info->thetacorr_given) { fprintf(outfile, "%s\n", "thetacorr"); } - if (args_info->actioncorr_given) { - fprintf(outfile, "%s\n", "actioncorr"); - } if (args_info->drcorr_given) { fprintf(outfile, "%s\n", "drcorr"); } @@ -285,7 +321,6 @@ reset_group_dynamicProps(struct gengetopt_args_info *a args_info->lcorr_given = 0 ; args_info->r_rcorr_given = 0 ; args_info->thetacorr_given = 0 ; - args_info->actioncorr_given = 0 ; args_info->drcorr_given = 0 ; args_info->dynamicProps_group_counter = 0; @@ -335,11 +370,13 @@ cmdline_parser_required2 (struct gengetopt_args_info * { int error = 0; + /* checks for required options */ if (! args_info->input_given) { fprintf (stderr, "%s: '--input' ('-i') option required%s\n", prog_name, (additional_error ? additional_error : "")); error = 1; } + if (args_info->dynamicProps_group_counter == 0) { fprintf (stderr, "%s: %d options of group dynamicProps were given. One is required.%s\n", prog_name, args_info->dynamicProps_group_counter, (additional_error ? additional_error : "")); @@ -347,6 +384,8 @@ cmdline_parser_required2 (struct gengetopt_args_info * } + /* checks for dependences among options */ + return error; } @@ -387,7 +426,6 @@ cmdline_parser_internal (int argc, char * const *argv, { "lcorr", 0, NULL, 'l' }, { "r_rcorr", 0, NULL, 0 }, { "thetacorr", 0, NULL, 0 }, - { "actioncorr", 0, NULL, 0 }, { "drcorr", 0, NULL, 0 }, { NULL, 0, NULL, 0 } }; @@ -595,23 +633,6 @@ cmdline_parser_internal (int argc, char * const *argv, continue; local_args_info.thetacorr_given = 1; args_info->thetacorr_given = 1; - if (args_info->dynamicProps_group_counter && override) - reset_group_dynamicProps (args_info); - args_info->dynamicProps_group_counter += 1; - break; - } - /* Action correlation function. */ - else if (strcmp (long_options[option_index].name, "actioncorr") == 0) - { - if (local_args_info.actioncorr_given) - { - fprintf (stderr, "%s: `--actioncorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); - goto failure; - } - if (args_info->actioncorr_given && ! override) - continue; - local_args_info.actioncorr_given = 1; - args_info->actioncorr_given = 1; if (args_info->dynamicProps_group_counter && override) reset_group_dynamicProps (args_info); args_info->dynamicProps_group_counter += 1;