| 1 |
|
/* |
| 2 |
|
File autogenerated by gengetopt version 2.11 |
| 3 |
|
generated with the following command: |
| 4 |
< |
/home/maul/gezelter/tim/program/gengetopt-2.11/src/gengetopt --file-name=Dump2XYZCmd |
| 4 |
> |
gengetopt -i Dump2XYZ.ggo |
| 5 |
|
|
| 6 |
|
The developers of gengetopt consider the fixed text that goes in all |
| 7 |
|
gengetopt output files to be in the public domain: |
| 18 |
|
#include "config.h" |
| 19 |
|
#endif |
| 20 |
|
|
| 21 |
– |
|
| 21 |
|
#include "getopt.h" |
| 22 |
|
|
| 23 |
< |
#include "applications/dump2Xyz/Dump2XYZCmd.h" |
| 23 |
> |
#include "Dump2XYZCmd.h" |
| 24 |
|
|
| 25 |
|
void |
| 26 |
|
cmdline_parser_print_version (void) |
| 35 |
|
printf("\n" |
| 36 |
|
"Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE); |
| 37 |
|
printf("\n"); |
| 38 |
< |
printf(" -h, --help Print help and exit\n"); |
| 39 |
< |
printf(" -V, --version Print version and exit\n"); |
| 40 |
< |
printf(" -i, --input=filename input dump file\n"); |
| 41 |
< |
printf(" -o, --output=filename output file name\n"); |
| 42 |
< |
printf(" -n, --frame=INT print every n frame (default=`1')\n"); |
| 43 |
< |
printf(" -d, --dipole print the dipole moments (default=off)\n"); |
| 44 |
< |
printf(" -w, --water skip the the waters (default=off)\n"); |
| 45 |
< |
printf(" -m, --periodicBox map to the periodic box (default=off)\n"); |
| 46 |
< |
printf(" -z, --zconstraint replace the atom types of zconstraint molecules \n (default=off)\n"); |
| 47 |
< |
printf(" -r, --rigidbody add a pseudo COM atom to rigidbody (default=off)\n"); |
| 48 |
< |
printf(" -t, --watertype replace the atom type of water model (default=on)\n"); |
| 49 |
< |
printf(" -s, --ignore=atomtype ignore the atom types\n"); |
| 50 |
< |
printf(" --repeatX=INT The number of images to repeat in the x direction \n (default=`0')\n"); |
| 51 |
< |
printf(" --repeatY=INT The number of images to repeat in the y direction \n (default=`0')\n"); |
| 52 |
< |
printf(" --repeatZ=INT The number of images to repeat in the z direction \n (default=`0')\n"); |
| 38 |
> |
printf(" -h, --help Print help and exit\n"); |
| 39 |
> |
printf(" -V, --version Print version and exit\n"); |
| 40 |
> |
printf(" -i, --input=filename input dump file\n"); |
| 41 |
> |
printf(" -o, --output=filename output file name\n"); |
| 42 |
> |
printf(" -n, --frame=INT print every n frame (default=`1')\n"); |
| 43 |
> |
printf(" -d, --dipole print the dipole moments (default=off)\n"); |
| 44 |
> |
printf(" -w, --water skip the the waters (default=off)\n"); |
| 45 |
> |
printf(" -m, --periodicBox map to the periodic box (default=off)\n"); |
| 46 |
> |
printf(" -z, --zconstraint replace the atom types of zconstraint \n molecules (default=off)\n"); |
| 47 |
> |
printf(" -r, --rigidbody add a pseudo COM atom to rigidbody \n (default=off)\n"); |
| 48 |
> |
printf(" -t, --watertype replace the atom type of water model \n (default=on)\n"); |
| 49 |
> |
printf(" -g, --ignore=atomtype ignore the atom types\n"); |
| 50 |
> |
printf(" -s, --selection=selection script general selection syntax(now only support \n select atoms within a specified range)\n"); |
| 51 |
> |
printf(" --repeatX=INT The number of images to repeat in the x \n direction (default=`0')\n"); |
| 52 |
> |
printf(" --repeatY=INT The number of images to repeat in the y \n direction (default=`0')\n"); |
| 53 |
> |
printf(" --repeatZ=INT The number of images to repeat in the z \n direction (default=`0')\n"); |
| 54 |
|
} |
| 55 |
|
|
| 56 |
|
|
| 94 |
|
args_info->rigidbody_given = 0 ; |
| 95 |
|
args_info->watertype_given = 0 ; |
| 96 |
|
args_info->ignore_given = 0 ; |
| 97 |
+ |
args_info->selection_given = 0 ; |
| 98 |
|
args_info->repeatX_given = 0 ; |
| 99 |
|
args_info->repeatY_given = 0 ; |
| 100 |
|
args_info->repeatZ_given = 0 ; |
| 109 |
|
args_info->rigidbody_flag = 0;\ |
| 110 |
|
args_info->watertype_flag = 1;\ |
| 111 |
|
args_info->ignore_arg = NULL; \ |
| 112 |
+ |
args_info->selection_arg = NULL; \ |
| 113 |
|
args_info->repeatX_arg = 0 ;\ |
| 114 |
|
args_info->repeatY_arg = 0 ;\ |
| 115 |
|
args_info->repeatZ_arg = 0 ;\ |
| 139 |
|
{ "zconstraint", 0, NULL, 'z' }, |
| 140 |
|
{ "rigidbody", 0, NULL, 'r' }, |
| 141 |
|
{ "watertype", 0, NULL, 't' }, |
| 142 |
< |
{ "ignore", 1, NULL, 's' }, |
| 142 |
> |
{ "ignore", 1, NULL, 'g' }, |
| 143 |
> |
{ "selection", 1, NULL, 's' }, |
| 144 |
|
{ "repeatX", 1, NULL, 0 }, |
| 145 |
|
{ "repeatY", 1, NULL, 0 }, |
| 146 |
|
{ "repeatZ", 1, NULL, 0 }, |
| 148 |
|
}; |
| 149 |
|
|
| 150 |
|
stop_char = 0; |
| 151 |
< |
c = getopt_long (argc, argv, "hVi:o:n:dwmzrts:", long_options, &option_index); |
| 151 |
> |
c = getopt_long (argc, argv, "hVi:o:n:dwmzrtg:s:", long_options, &option_index); |
| 152 |
|
|
| 153 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
| 154 |
|
|
| 263 |
|
args_info->watertype_flag = !(args_info->watertype_flag); |
| 264 |
|
break; |
| 265 |
|
|
| 266 |
< |
case 's': /* ignore the atom types. */ |
| 266 |
> |
case 'g': /* ignore the atom types. */ |
| 267 |
|
args_info->ignore_given++; |
| 268 |
|
ignore_new = (struct ignore_list *) malloc (sizeof (struct ignore_list)); |
| 269 |
|
ignore_new->next = ignore_list; |
| 271 |
|
ignore_new->ignore_arg = gengetopt_strdup (optarg); |
| 272 |
|
break; |
| 273 |
|
|
| 274 |
+ |
case 's': /* general selection syntax(now only support select atoms within a specified range). */ |
| 275 |
+ |
if (args_info->selection_given) |
| 276 |
+ |
{ |
| 277 |
+ |
fprintf (stderr, "%s: `--selection' (`-s') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 278 |
+ |
clear_args (); |
| 279 |
+ |
exit (EXIT_FAILURE); |
| 280 |
+ |
} |
| 281 |
+ |
args_info->selection_given = 1; |
| 282 |
+ |
args_info->selection_arg = gengetopt_strdup (optarg); |
| 283 |
+ |
break; |
| 284 |
|
|
| 285 |
+ |
|
| 286 |
|
case 0: /* Long option with no short option */ |
| 287 |
|
/* The number of images to repeat in the x direction. */ |
| 288 |
|
if (strcmp (long_options[option_index].name, "repeatX") == 0) |