--- trunk/src/applications/dynamicProps/DynamicPropsCmd.c 2006/12/14 19:38:56 1098 +++ trunk/src/applications/dynamicProps/DynamicPropsCmd.c 2007/01/03 20:47:00 1112 @@ -1,7 +1,7 @@ /* File autogenerated by gengetopt version 2.15 generated with the following command: - gengetopt -i DynamicProps.ggo --file-name=DynamicPropsCmd + gengetopt -u -i DynamicProps.ggo -F DynamicPropsCmd The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: @@ -50,6 +50,7 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->dcorr_given = 0 ; args_info->lcorr_given = 0 ; args_info->r_rcorr_given = 0 ; + args_info->thetacorr_given = 0 ; args_info->dynamicProps_group_counter = 0 ; } @@ -78,7 +79,7 @@ cmdline_parser_print_help (void) cmdline_parser_print_help (void) { cmdline_parser_print_version (); - printf("\nUsage: DynamicProps [OPTIONS]...\n\n"); + printf("\nUsage: DynamicProps [OPTIONS]... [FILES]...\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"); @@ -92,6 +93,7 @@ cmdline_parser_print_help (void) 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"); } @@ -100,12 +102,16 @@ cmdline_parser_init (struct gengetopt_args_info *args_ { clear_given (args_info); clear_args (args_info); + + args_info->inputs = NULL; + args_info->inputs_num = 0; } static void cmdline_parser_release (struct gengetopt_args_info *args_info) { + unsigned int i; if (args_info->input_arg) { free (args_info->input_arg); /* free previous argument */ @@ -151,7 +157,13 @@ cmdline_parser_release (struct gengetopt_args_info *ar free (args_info->order_orig); /* free previous argument */ args_info->order_orig = 0; } + + for (i = 0; i < args_info->inputs_num; ++i) + free (args_info->inputs [i]); + if (args_info->inputs_num) + free (args_info->inputs); + clear_given (args_info); } @@ -225,6 +237,9 @@ cmdline_parser_file_save(const char *filename, struct if (args_info->r_rcorr_given) { fprintf(outfile, "%s\n", "r_rcorr"); } + if (args_info->thetacorr_given) { + fprintf(outfile, "%s\n", "thetacorr"); + } fclose (outfile); @@ -269,6 +284,7 @@ reset_group_dynamicProps(struct gengetopt_args_info *a args_info->dcorr_given = 0 ; args_info->lcorr_given = 0 ; args_info->r_rcorr_given = 0 ; + args_info->thetacorr_given = 0 ; args_info->dynamicProps_group_counter = 0; } @@ -368,6 +384,7 @@ cmdline_parser_internal (int argc, char * const *argv, { "dcorr", 0, NULL, 'd' }, { "lcorr", 0, NULL, 'l' }, { "r_rcorr", 0, NULL, 0 }, + { "thetacorr", 0, NULL, 0 }, { NULL, 0, NULL, 0 } }; @@ -562,6 +579,23 @@ cmdline_parser_internal (int argc, char * const *argv, args_info->dynamicProps_group_counter += 1; break; } + /* Angular rmsd. */ + else if (strcmp (long_options[option_index].name, "thetacorr") == 0) + { + if (local_args_info.thetacorr_given) + { + fprintf (stderr, "%s: `--thetacorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->thetacorr_given && ! override) + 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; + } break; case '?': /* Invalid option. */ @@ -592,6 +626,17 @@ cmdline_parser_internal (int argc, char * const *argv, if ( error ) return (EXIT_FAILURE); + if (optind < argc) + { + int i = 0 ; + + args_info->inputs_num = argc - optind ; + args_info->inputs = + (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ; + while (optind < argc) + args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind++]) ; + } + return 0; failure: