1 |
|
/* |
2 |
|
File autogenerated by gengetopt version 2.11 |
3 |
|
generated with the following command: |
4 |
< |
/home/maul/gezelter/tim/bin/gengetopt -F Dump2XYZCmd |
4 |
> |
/home/maul/gezelter/tim/program/gengetopt-2.11/src/gengetopt -F Dump2XYZCmd |
5 |
|
|
6 |
|
The developers of gengetopt consider the fixed text that goes in all |
7 |
|
gengetopt output files to be in the public domain: |
33 |
|
{ |
34 |
|
cmdline_parser_print_version (); |
35 |
|
printf("\n" |
36 |
< |
"Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE); |
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"); |
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 |
+ |
printf(" --gb=atomtype Replace the Gay-Berne atom with four \n linear atoms\n"); |
55 |
+ |
printf(" -b, --basetype Convert to base atom type (default=off)\n"); |
56 |
|
} |
57 |
|
|
58 |
|
|
92 |
|
args_info->repeatX_given = 0 ; |
93 |
|
args_info->repeatY_given = 0 ; |
94 |
|
args_info->repeatZ_given = 0 ; |
95 |
< |
#define clear_args() { \ |
96 |
< |
args_info->input_arg = NULL; \ |
97 |
< |
args_info->output_arg = NULL; \ |
98 |
< |
args_info->frame_arg = 1 ; \ |
99 |
< |
args_info->water_flag = 0; \ |
100 |
< |
args_info->periodicBox_flag = 0; \ |
101 |
< |
args_info->zconstraint_flag = 0; \ |
102 |
< |
args_info->rigidbody_flag = 0; \ |
103 |
< |
args_info->watertype_flag = 1; \ |
104 |
< |
args_info->selection_arg = NULL; \ |
105 |
< |
args_info->originsele_arg = NULL; \ |
106 |
< |
args_info->refsele_arg = NULL; \ |
107 |
< |
args_info->repeatX_arg = 0 ; \ |
108 |
< |
args_info->repeatY_arg = 0 ; \ |
109 |
< |
args_info->repeatZ_arg = 0 ; \ |
110 |
< |
} |
95 |
> |
args_info->gb_given = 0 ; |
96 |
> |
args_info->basetype_given = 0 ; |
97 |
> |
#define clear_args() { \ |
98 |
> |
args_info->input_arg = NULL; \ |
99 |
> |
args_info->output_arg = NULL; \ |
100 |
> |
args_info->frame_arg = 1 ;\ |
101 |
> |
args_info->water_flag = 0;\ |
102 |
> |
args_info->periodicBox_flag = 0;\ |
103 |
> |
args_info->zconstraint_flag = 0;\ |
104 |
> |
args_info->rigidbody_flag = 0;\ |
105 |
> |
args_info->watertype_flag = 1;\ |
106 |
> |
args_info->selection_arg = NULL; \ |
107 |
> |
args_info->originsele_arg = NULL; \ |
108 |
> |
args_info->refsele_arg = NULL; \ |
109 |
> |
args_info->repeatX_arg = 0 ;\ |
110 |
> |
args_info->repeatY_arg = 0 ;\ |
111 |
> |
args_info->repeatZ_arg = 0 ;\ |
112 |
> |
args_info->gb_arg = NULL; \ |
113 |
> |
args_info->basetype_flag = 0;\ |
114 |
> |
} |
115 |
|
|
116 |
|
clear_args(); |
117 |
|
|
142 |
|
{ "repeatX", 1, NULL, 0 }, |
143 |
|
{ "repeatY", 1, NULL, 0 }, |
144 |
|
{ "repeatZ", 1, NULL, 0 }, |
145 |
+ |
{ "gb", 1, NULL, 0 }, |
146 |
+ |
{ "basetype", 0, NULL, 'b' }, |
147 |
|
{ NULL, 0, NULL, 0 } |
148 |
|
}; |
149 |
|
|
150 |
|
stop_char = 0; |
151 |
< |
c = getopt_long (argc, argv, "hVi:o:n:wmzrts:", long_options, &option_index); |
151 |
> |
c = getopt_long (argc, argv, "hVi:o:n:wmzrts:b", long_options, &option_index); |
152 |
|
|
153 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
154 |
|
|
263 |
|
args_info->selection_arg = gengetopt_strdup (optarg); |
264 |
|
break; |
265 |
|
|
266 |
+ |
case 'b': /* Convert to base atom type. */ |
267 |
+ |
if (args_info->basetype_given) |
268 |
+ |
{ |
269 |
+ |
fprintf (stderr, "%s: `--basetype' (`-b') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
270 |
+ |
clear_args (); |
271 |
+ |
exit (EXIT_FAILURE); |
272 |
+ |
} |
273 |
+ |
args_info->basetype_given = 1; |
274 |
+ |
args_info->basetype_flag = !(args_info->basetype_flag); |
275 |
+ |
break; |
276 |
|
|
277 |
+ |
|
278 |
|
case 0: /* Long option with no short option */ |
279 |
|
/* select origin. */ |
280 |
|
if (strcmp (long_options[option_index].name, "originsele") == 0) |
281 |
< |
{ |
282 |
< |
if (args_info->originsele_given) |
283 |
< |
{ |
284 |
< |
fprintf (stderr, "%s: `--originsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
285 |
< |
clear_args (); |
286 |
< |
exit (EXIT_FAILURE); |
287 |
< |
} |
288 |
< |
args_info->originsele_given = 1; |
289 |
< |
args_info->originsele_arg = gengetopt_strdup (optarg); |
290 |
< |
break; |
291 |
< |
} |
281 |
> |
{ |
282 |
> |
if (args_info->originsele_given) |
283 |
> |
{ |
284 |
> |
fprintf (stderr, "%s: `--originsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
285 |
> |
clear_args (); |
286 |
> |
exit (EXIT_FAILURE); |
287 |
> |
} |
288 |
> |
args_info->originsele_given = 1; |
289 |
> |
args_info->originsele_arg = gengetopt_strdup (optarg); |
290 |
> |
break; |
291 |
> |
} |
292 |
|
|
293 |
|
/* select reference. */ |
294 |
|
else if (strcmp (long_options[option_index].name, "refsele") == 0) |
295 |
< |
{ |
296 |
< |
if (args_info->refsele_given) |
297 |
< |
{ |
298 |
< |
fprintf (stderr, "%s: `--refsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
299 |
< |
clear_args (); |
300 |
< |
exit (EXIT_FAILURE); |
301 |
< |
} |
302 |
< |
args_info->refsele_given = 1; |
303 |
< |
args_info->refsele_arg = gengetopt_strdup (optarg); |
304 |
< |
break; |
305 |
< |
} |
295 |
> |
{ |
296 |
> |
if (args_info->refsele_given) |
297 |
> |
{ |
298 |
> |
fprintf (stderr, "%s: `--refsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
299 |
> |
clear_args (); |
300 |
> |
exit (EXIT_FAILURE); |
301 |
> |
} |
302 |
> |
args_info->refsele_given = 1; |
303 |
> |
args_info->refsele_arg = gengetopt_strdup (optarg); |
304 |
> |
break; |
305 |
> |
} |
306 |
|
|
307 |
|
/* The number of images to repeat in the x direction. */ |
308 |
|
else if (strcmp (long_options[option_index].name, "repeatX") == 0) |
309 |
< |
{ |
310 |
< |
if (args_info->repeatX_given) |
311 |
< |
{ |
312 |
< |
fprintf (stderr, "%s: `--repeatX' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
313 |
< |
clear_args (); |
314 |
< |
exit (EXIT_FAILURE); |
315 |
< |
} |
316 |
< |
args_info->repeatX_given = 1; |
317 |
< |
args_info->repeatX_arg = strtol (optarg,&stop_char,0); |
318 |
< |
break; |
319 |
< |
} |
309 |
> |
{ |
310 |
> |
if (args_info->repeatX_given) |
311 |
> |
{ |
312 |
> |
fprintf (stderr, "%s: `--repeatX' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
313 |
> |
clear_args (); |
314 |
> |
exit (EXIT_FAILURE); |
315 |
> |
} |
316 |
> |
args_info->repeatX_given = 1; |
317 |
> |
args_info->repeatX_arg = strtol (optarg,&stop_char,0); |
318 |
> |
break; |
319 |
> |
} |
320 |
|
|
321 |
|
/* The number of images to repeat in the y direction. */ |
322 |
|
else if (strcmp (long_options[option_index].name, "repeatY") == 0) |
323 |
< |
{ |
324 |
< |
if (args_info->repeatY_given) |
325 |
< |
{ |
326 |
< |
fprintf (stderr, "%s: `--repeatY' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
327 |
< |
clear_args (); |
328 |
< |
exit (EXIT_FAILURE); |
329 |
< |
} |
330 |
< |
args_info->repeatY_given = 1; |
331 |
< |
args_info->repeatY_arg = strtol (optarg,&stop_char,0); |
332 |
< |
break; |
333 |
< |
} |
323 |
> |
{ |
324 |
> |
if (args_info->repeatY_given) |
325 |
> |
{ |
326 |
> |
fprintf (stderr, "%s: `--repeatY' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
327 |
> |
clear_args (); |
328 |
> |
exit (EXIT_FAILURE); |
329 |
> |
} |
330 |
> |
args_info->repeatY_given = 1; |
331 |
> |
args_info->repeatY_arg = strtol (optarg,&stop_char,0); |
332 |
> |
break; |
333 |
> |
} |
334 |
|
|
335 |
|
/* The number of images to repeat in the z direction. */ |
336 |
|
else if (strcmp (long_options[option_index].name, "repeatZ") == 0) |
337 |
< |
{ |
338 |
< |
if (args_info->repeatZ_given) |
339 |
< |
{ |
340 |
< |
fprintf (stderr, "%s: `--repeatZ' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
341 |
< |
clear_args (); |
342 |
< |
exit (EXIT_FAILURE); |
343 |
< |
} |
344 |
< |
args_info->repeatZ_given = 1; |
345 |
< |
args_info->repeatZ_arg = strtol (optarg,&stop_char,0); |
346 |
< |
break; |
347 |
< |
} |
337 |
> |
{ |
338 |
> |
if (args_info->repeatZ_given) |
339 |
> |
{ |
340 |
> |
fprintf (stderr, "%s: `--repeatZ' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
341 |
> |
clear_args (); |
342 |
> |
exit (EXIT_FAILURE); |
343 |
> |
} |
344 |
> |
args_info->repeatZ_given = 1; |
345 |
> |
args_info->repeatZ_arg = strtol (optarg,&stop_char,0); |
346 |
> |
break; |
347 |
> |
} |
348 |
|
|
349 |
+ |
/* Replace the Gay-Berne atom with four linear atoms. */ |
350 |
+ |
else if (strcmp (long_options[option_index].name, "gb") == 0) |
351 |
+ |
{ |
352 |
+ |
if (args_info->gb_given) |
353 |
+ |
{ |
354 |
+ |
fprintf (stderr, "%s: `--gb' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
355 |
+ |
clear_args (); |
356 |
+ |
exit (EXIT_FAILURE); |
357 |
+ |
} |
358 |
+ |
args_info->gb_given = 1; |
359 |
+ |
args_info->gb_arg = gengetopt_strdup (optarg); |
360 |
+ |
break; |
361 |
+ |
} |
362 |
+ |
|
363 |
|
|
364 |
|
case '?': /* Invalid option. */ |
365 |
|
/* `getopt_long' already printed an error message. */ |