--- trunk/src/applications/staticProps/StaticPropsCmd.c 2006/09/26 01:30:32 1052 +++ trunk/src/applications/staticProps/StaticPropsCmd.c 2006/11/10 18:45:29 1091 @@ -1,7 +1,7 @@ /* - File autogenerated by gengetopt version 2.16 + File autogenerated by gengetopt version 2.15 generated with the following command: - gengetopt -F StaticPropsCmd + gengetopt -i StaticProps.ggo -F StaticPropsCmd The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: @@ -57,6 +57,7 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->molname_given = 0 ; args_info->begin_given = 0 ; args_info->end_given = 0 ; + args_info->radius_given = 0 ; args_info->bo_given = 0 ; args_info->gofr_given = 0 ; args_info->r_theta_given = 0 ; @@ -69,6 +70,7 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->density_given = 0 ; args_info->slab_density_given = 0 ; args_info->hxy_given = 0 ; + args_info->rho_r_given = 0 ; args_info->staticProps_group_counter = 0 ; } @@ -105,6 +107,7 @@ void clear_args (struct gengetopt_args_info *args_info args_info->molname_orig = NULL; args_info->begin_orig = NULL; args_info->end_orig = NULL; + args_info->radius_orig = NULL; } @@ -138,6 +141,7 @@ cmdline_parser_print_help (void) printf("%s\n"," --molname=STRING molecule name"); printf("%s\n"," --begin=INT begin internal index"); printf("%s\n"," --end=INT end internal index"); + printf("%s\n"," --radius=DOUBLE nanoparticle radius"); printf("%s\n","\n Group: staticProps\n an option of this group is required"); printf("%s\n"," --bo bond order parameter (--rcut must be specified"); printf("%s\n"," -g, --gofr g(r)"); @@ -151,6 +155,7 @@ cmdline_parser_print_help (void) printf("%s\n"," -d, --density density plot"); printf("%s\n"," --slab_density slab density"); printf("%s\n"," --hxy hxy"); + printf("%s\n"," --rho_r rho of R"); } @@ -284,6 +289,11 @@ cmdline_parser_release (struct gengetopt_args_info *ar { free (args_info->end_orig); /* free previous argument */ args_info->end_orig = 0; + } + if (args_info->radius_orig) + { + free (args_info->radius_orig); /* free previous argument */ + args_info->radius_orig = 0; } clear_given (args_info); @@ -428,6 +438,13 @@ cmdline_parser_file_save(const char *filename, struct fprintf(outfile, "%s\n", "end"); } } + if (args_info->radius_given) { + if (args_info->radius_orig) { + fprintf(outfile, "%s=\"%s\"\n", "radius", args_info->radius_orig); + } else { + fprintf(outfile, "%s\n", "radius"); + } + } if (args_info->bo_given) { fprintf(outfile, "%s\n", "bo"); } @@ -464,6 +481,9 @@ cmdline_parser_file_save(const char *filename, struct if (args_info->hxy_given) { fprintf(outfile, "%s\n", "hxy"); } + if (args_info->rho_r_given) { + fprintf(outfile, "%s\n", "rho_r"); + } fclose (outfile); @@ -515,6 +535,7 @@ reset_group_staticProps(struct gengetopt_args_info *ar args_info->density_given = 0 ; args_info->slab_density_given = 0 ; args_info->hxy_given = 0 ; + args_info->rho_r_given = 0 ; args_info->staticProps_group_counter = 0; } @@ -592,7 +613,7 @@ cmdline_parser_internal (int argc, char * const *argv, cmdline_parser_init (&local_args_info); optarg = 0; - optind = 0; + optind = 1; opterr = 1; optopt = '?'; @@ -621,6 +642,7 @@ cmdline_parser_internal (int argc, char * const *argv, { "molname", 1, NULL, 0 }, { "begin", 1, NULL, 0 }, { "end", 1, NULL, 0 }, + { "radius", 1, NULL, 0 }, { "bo", 0, NULL, 0 }, { "gofr", 0, NULL, 'g' }, { "r_theta", 0, NULL, 0 }, @@ -633,6 +655,7 @@ cmdline_parser_internal (int argc, char * const *argv, { "density", 0, NULL, 'd' }, { "slab_density", 0, NULL, 0 }, { "hxy", 0, NULL, 0 }, + { "rho_r", 0, NULL, 0 }, { NULL, 0, NULL, 0 } }; @@ -1049,6 +1072,27 @@ cmdline_parser_internal (int argc, char * const *argv, free (args_info->end_orig); /* free previous string */ args_info->end_orig = gengetopt_strdup (optarg); } + /* nanoparticle radius. */ + else if (strcmp (long_options[option_index].name, "radius") == 0) + { + if (local_args_info.radius_given) + { + fprintf (stderr, "%s: `--radius' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->radius_given && ! override) + continue; + local_args_info.radius_given = 1; + args_info->radius_given = 1; + args_info->radius_arg = strtod (optarg, &stop_char); + if (!(stop_char && *stop_char == '\0')) { + fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); + goto failure; + } + if (args_info->radius_orig) + free (args_info->radius_orig); /* free previous string */ + args_info->radius_orig = gengetopt_strdup (optarg); + } /* bond order parameter (--rcut must be specified. */ else if (strcmp (long_options[option_index].name, "bo") == 0) { @@ -1185,6 +1229,23 @@ cmdline_parser_internal (int argc, char * const *argv, args_info->staticProps_group_counter += 1; break; } + /* rho of R. */ + else if (strcmp (long_options[option_index].name, "rho_r") == 0) + { + if (local_args_info.rho_r_given) + { + fprintf (stderr, "%s: `--rho_r' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->rho_r_given && ! override) + continue; + local_args_info.rho_r_given = 1; + args_info->rho_r_given = 1; + if (args_info->staticProps_group_counter && override) + reset_group_staticProps (args_info); + args_info->staticProps_group_counter += 1; + break; + } break; case '?': /* Invalid option. */