ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/staticProps/StaticPropsCmd.cpp
(Generate patch)

Comparing:
trunk/src/applications/staticProps/StaticPropsCmd.c (file contents), Revision 1128 by chuckv, Wed Apr 11 23:27:20 2007 UTC vs.
trunk/src/applications/staticProps/StaticPropsCmd.cpp (file contents), Revision 1795 by gezelter, Fri Sep 7 18:13:55 2012 UTC

# Line 1 | Line 1
1   /*
2 <  File autogenerated by gengetopt version 2.19.1
2 >  File autogenerated by gengetopt version 2.22.4
3    generated with the following command:
4 <  gengetopt -i StaticProps.ggo -F StaticPropsCmd -u
4 >  gengetopt -i StaticProps.ggo -c cpp -F StaticPropsCmd -u
5  
6    The developers of gengetopt consider the fixed text that goes in all
7    gengetopt output files to be in the public domain:
# Line 17 | Line 17
17   #include <stdlib.h>
18   #include <string.h>
19  
20 < #include "getopt.h"
20 > #ifndef FIX_UNUSED
21 > #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
22 > #endif
23  
24 + #ifdef WIN32
25 + #include "utils/wingetopt.h"
26 + #else
27 + #include <getopt.h>
28 + #endif
29 +
30   #include "StaticPropsCmd.h"
31  
32   const char *gengetopt_args_info_purpose = "";
# Line 36 | Line 44 | const char *gengetopt_args_info_help[] = {
44    "  -b, --nbins=INT               number of bins (general purpose)  \n                                  (default=`100')",
45    "  -x, --nbins_x=INT             number of bins in x axis  (default=`100')",
46    "  -y, --nbins_y=INT             number of bins in y axis  (default=`100')",
47 +  "      --nbins_z=INT             number of bins in z axis  (default=`100')",
48    "  -a, --nanglebins=INT          number of bins for cos(angle)  (default=`50')",
40  "      --length=DOUBLE           maximum length (Defaults to 1/2 smallest length \n                                  of first frame)",
49    "  -c, --rcut=DOUBLE             cutoff radius (rcut)",
50 +  "      --dz=DOUBLE               slab width (dz)",
51 +  "      --length=DOUBLE           maximum length (Defaults to 1/2 smallest length \n                                  of first frame)",
52 +  "      --zlength=DOUBLE          maximum length (Defaults to 1/2 smallest length \n                                  of first frame)",
53    "  -z, --zoffset=DOUBLE          Where to set the zero for the slab_density \n                                  calculation  (default=`0')",
54    "      --sele1=selection script  select the first stuntdouble set",
55    "      --sele2=selection script  select the second stuntdouble set",
56    "      --sele3=selection script  select the third stuntdouble set",
57    "      --refsele=selection script\n                                select reference (use and only use with --gxyz)",
58 +  "      --comsele=selection script\n                                select stunt doubles for center-of-mass \n                                  reference point",
59    "      --molname=STRING          molecule name",
60    "      --begin=INT               begin internal index",
61    "      --end=INT                 end internal index",
# Line 51 | Line 63 | const char *gengetopt_args_info_help[] = {
63    "\n Group: staticProps\n   an option of this group is required",
64    "      --bo                      bond order parameter (--rcut must be specified)",
65    "      --bor                     bond order parameter as a function of radius \n                                  (--rcut must be specified)",
66 +  "      --bad                     N(theta) bond angle density within (--rcut must \n                                  be specified)",
67 +  "      --count                   count of molecules matching selection criteria \n                                  (and associated statistics)",
68    "  -g, --gofr                    g(r)",
69 +  "      --gofz                    g(z)",
70    "      --r_theta                 g(r, cos(theta))",
71    "      --r_omega                 g(r, cos(omega))",
72 +  "      --r_z                     g(r, z)",
73    "      --theta_omega             g(cos(theta), cos(omega))",
74    "      --gxyz                    g(x, y, z)",
75 <  "  -p, --p2                      p2 order parameter (--sele1 and --sele2 must be \n                                  specified)",
75 >  "      --twodgofr                2D g(r) (Slab width --dz must be specified)",
76 >  "  -p, --p2                      p2 order parameter (--sele1 must be specified, \n                                  --sele2 is optional)",
77    "      --rp2                     rp2 order parameter (--sele1 and --sele2 must \n                                  be specified)",
78    "  -s, --scd                     scd order parameter (either --sele1, --sele2, \n                                  --sele3 are specified or --molname, --begin, \n                                  --end are specified)",
79    "  -d, --density                 density plot",
80    "      --slab_density            slab density",
81 +  "      --p_angle                 p(cos(theta))",
82    "      --hxy                     hxy",
83    "      --rho_r                   rho of R",
84 +  "      --angle_r                 angle of R",
85 +  "      --hullvol                 hull volume of nanoparticle",
86 +  "      --rodlength               length of nanorod",
87 +  "  -Q, --tet_param               tetrahedrality order parameter",
88 +  "      --tet_param_z             tetrahedrality order parameter by zbin(--sele1 \n                                  must be specified)",
89      0
90   };
91  
92 + typedef enum {ARG_NO
93 +  , ARG_STRING
94 +  , ARG_INT
95 +  , ARG_DOUBLE
96 + } cmdline_parser_arg_type;
97 +
98   static
99   void clear_given (struct gengetopt_args_info *args_info);
100   static
101   void clear_args (struct gengetopt_args_info *args_info);
102  
103   static int
104 < cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required, const char *additional_error);
104 > cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
105 >                        struct cmdline_parser_params *params, const char *additional_error);
106  
107   static int
108   cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error);
# Line 91 | Line 121 | void clear_given (struct gengetopt_args_info *args_inf
121    args_info->nbins_given = 0 ;
122    args_info->nbins_x_given = 0 ;
123    args_info->nbins_y_given = 0 ;
124 +  args_info->nbins_z_given = 0 ;
125    args_info->nanglebins_given = 0 ;
95  args_info->length_given = 0 ;
126    args_info->rcut_given = 0 ;
127 +  args_info->dz_given = 0 ;
128 +  args_info->length_given = 0 ;
129 +  args_info->zlength_given = 0 ;
130    args_info->zoffset_given = 0 ;
131    args_info->sele1_given = 0 ;
132    args_info->sele2_given = 0 ;
133    args_info->sele3_given = 0 ;
134    args_info->refsele_given = 0 ;
135 +  args_info->comsele_given = 0 ;
136    args_info->molname_given = 0 ;
137    args_info->begin_given = 0 ;
138    args_info->end_given = 0 ;
139    args_info->radius_given = 0 ;
140    args_info->bo_given = 0 ;
141    args_info->bor_given = 0 ;
142 +  args_info->bad_given = 0 ;
143 +  args_info->count_given = 0 ;
144    args_info->gofr_given = 0 ;
145 +  args_info->gofz_given = 0 ;
146    args_info->r_theta_given = 0 ;
147    args_info->r_omega_given = 0 ;
148 +  args_info->r_z_given = 0 ;
149    args_info->theta_omega_given = 0 ;
150    args_info->gxyz_given = 0 ;
151 +  args_info->twodgofr_given = 0 ;
152    args_info->p2_given = 0 ;
153    args_info->rp2_given = 0 ;
154    args_info->scd_given = 0 ;
155    args_info->density_given = 0 ;
156    args_info->slab_density_given = 0 ;
157 +  args_info->p_angle_given = 0 ;
158    args_info->hxy_given = 0 ;
159    args_info->rho_r_given = 0 ;
160 +  args_info->angle_r_given = 0 ;
161 +  args_info->hullvol_given = 0 ;
162 +  args_info->rodlength_given = 0 ;
163 +  args_info->tet_param_given = 0 ;
164 +  args_info->tet_param_z_given = 0 ;
165    args_info->staticProps_group_counter = 0 ;
166   }
167  
168   static
169   void clear_args (struct gengetopt_args_info *args_info)
170   {
171 +  FIX_UNUSED (args_info);
172    args_info->input_arg = NULL;
173    args_info->input_orig = NULL;
174    args_info->output_arg = NULL;
# Line 135 | Line 181 | void clear_args (struct gengetopt_args_info *args_info
181    args_info->nbins_x_orig = NULL;
182    args_info->nbins_y_arg = 100;
183    args_info->nbins_y_orig = NULL;
184 +  args_info->nbins_z_arg = 100;
185 +  args_info->nbins_z_orig = NULL;
186    args_info->nanglebins_arg = 50;
187    args_info->nanglebins_orig = NULL;
140  args_info->length_orig = NULL;
188    args_info->rcut_orig = NULL;
189 +  args_info->dz_orig = NULL;
190 +  args_info->length_orig = NULL;
191 +  args_info->zlength_orig = NULL;
192    args_info->zoffset_arg = 0;
193    args_info->zoffset_orig = NULL;
194    args_info->sele1_arg = NULL;
# Line 149 | Line 199 | void clear_args (struct gengetopt_args_info *args_info
199    args_info->sele3_orig = NULL;
200    args_info->refsele_arg = NULL;
201    args_info->refsele_orig = NULL;
202 +  args_info->comsele_arg = NULL;
203 +  args_info->comsele_orig = NULL;
204    args_info->molname_arg = NULL;
205    args_info->molname_orig = NULL;
206    args_info->begin_orig = NULL;
# Line 160 | Line 212 | void init_args_info(struct gengetopt_args_info *args_i
212   static
213   void init_args_info(struct gengetopt_args_info *args_info)
214   {
215 +
216 +
217    args_info->help_help = gengetopt_args_info_help[0] ;
218    args_info->version_help = gengetopt_args_info_help[1] ;
219    args_info->input_help = gengetopt_args_info_help[2] ;
# Line 168 | Line 222 | void init_args_info(struct gengetopt_args_info *args_i
222    args_info->nbins_help = gengetopt_args_info_help[5] ;
223    args_info->nbins_x_help = gengetopt_args_info_help[6] ;
224    args_info->nbins_y_help = gengetopt_args_info_help[7] ;
225 <  args_info->nanglebins_help = gengetopt_args_info_help[8] ;
226 <  args_info->length_help = gengetopt_args_info_help[9] ;
225 >  args_info->nbins_z_help = gengetopt_args_info_help[8] ;
226 >  args_info->nanglebins_help = gengetopt_args_info_help[9] ;
227    args_info->rcut_help = gengetopt_args_info_help[10] ;
228 <  args_info->zoffset_help = gengetopt_args_info_help[11] ;
229 <  args_info->sele1_help = gengetopt_args_info_help[12] ;
230 <  args_info->sele2_help = gengetopt_args_info_help[13] ;
231 <  args_info->sele3_help = gengetopt_args_info_help[14] ;
232 <  args_info->refsele_help = gengetopt_args_info_help[15] ;
233 <  args_info->molname_help = gengetopt_args_info_help[16] ;
234 <  args_info->begin_help = gengetopt_args_info_help[17] ;
235 <  args_info->end_help = gengetopt_args_info_help[18] ;
236 <  args_info->radius_help = gengetopt_args_info_help[19] ;
237 <  args_info->bo_help = gengetopt_args_info_help[20] ;
238 <  args_info->bor_help = gengetopt_args_info_help[21] ;
239 <  args_info->gofr_help = gengetopt_args_info_help[22] ;
240 <  args_info->r_theta_help = gengetopt_args_info_help[23] ;
241 <  args_info->r_omega_help = gengetopt_args_info_help[24] ;
242 <  args_info->theta_omega_help = gengetopt_args_info_help[25] ;
243 <  args_info->gxyz_help = gengetopt_args_info_help[26] ;
244 <  args_info->p2_help = gengetopt_args_info_help[27] ;
245 <  args_info->rp2_help = gengetopt_args_info_help[28] ;
246 <  args_info->scd_help = gengetopt_args_info_help[29] ;
247 <  args_info->density_help = gengetopt_args_info_help[30] ;
248 <  args_info->slab_density_help = gengetopt_args_info_help[31] ;
249 <  args_info->hxy_help = gengetopt_args_info_help[32] ;
250 <  args_info->rho_r_help = gengetopt_args_info_help[33] ;
228 >  args_info->dz_help = gengetopt_args_info_help[11] ;
229 >  args_info->length_help = gengetopt_args_info_help[12] ;
230 >  args_info->zlength_help = gengetopt_args_info_help[13] ;
231 >  args_info->zoffset_help = gengetopt_args_info_help[14] ;
232 >  args_info->sele1_help = gengetopt_args_info_help[15] ;
233 >  args_info->sele2_help = gengetopt_args_info_help[16] ;
234 >  args_info->sele3_help = gengetopt_args_info_help[17] ;
235 >  args_info->refsele_help = gengetopt_args_info_help[18] ;
236 >  args_info->comsele_help = gengetopt_args_info_help[19] ;
237 >  args_info->molname_help = gengetopt_args_info_help[20] ;
238 >  args_info->begin_help = gengetopt_args_info_help[21] ;
239 >  args_info->end_help = gengetopt_args_info_help[22] ;
240 >  args_info->radius_help = gengetopt_args_info_help[23] ;
241 >  args_info->bo_help = gengetopt_args_info_help[25] ;
242 >  args_info->bor_help = gengetopt_args_info_help[26] ;
243 >  args_info->bad_help = gengetopt_args_info_help[27] ;
244 >  args_info->count_help = gengetopt_args_info_help[28] ;
245 >  args_info->gofr_help = gengetopt_args_info_help[29] ;
246 >  args_info->gofz_help = gengetopt_args_info_help[30] ;
247 >  args_info->r_theta_help = gengetopt_args_info_help[31] ;
248 >  args_info->r_omega_help = gengetopt_args_info_help[32] ;
249 >  args_info->r_z_help = gengetopt_args_info_help[33] ;
250 >  args_info->theta_omega_help = gengetopt_args_info_help[34] ;
251 >  args_info->gxyz_help = gengetopt_args_info_help[35] ;
252 >  args_info->twodgofr_help = gengetopt_args_info_help[36] ;
253 >  args_info->p2_help = gengetopt_args_info_help[37] ;
254 >  args_info->rp2_help = gengetopt_args_info_help[38] ;
255 >  args_info->scd_help = gengetopt_args_info_help[39] ;
256 >  args_info->density_help = gengetopt_args_info_help[40] ;
257 >  args_info->slab_density_help = gengetopt_args_info_help[41] ;
258 >  args_info->p_angle_help = gengetopt_args_info_help[42] ;
259 >  args_info->hxy_help = gengetopt_args_info_help[43] ;
260 >  args_info->rho_r_help = gengetopt_args_info_help[44] ;
261 >  args_info->angle_r_help = gengetopt_args_info_help[45] ;
262 >  args_info->hullvol_help = gengetopt_args_info_help[46] ;
263 >  args_info->rodlength_help = gengetopt_args_info_help[47] ;
264 >  args_info->tet_param_help = gengetopt_args_info_help[48] ;
265 >  args_info->tet_param_z_help = gengetopt_args_info_help[49] ;
266    
267   }
268  
269   void
270   cmdline_parser_print_version (void)
271   {
272 <  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
272 >  printf ("%s %s\n",
273 >     (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
274 >     CMDLINE_PARSER_VERSION);
275   }
276  
277 < void
207 < cmdline_parser_print_help (void)
208 < {
209 <  int i = 0;
277 > static void print_help_common(void) {
278    cmdline_parser_print_version ();
279  
280    if (strlen(gengetopt_args_info_purpose) > 0)
281      printf("\n%s\n", gengetopt_args_info_purpose);
282  
283 <  printf("\n%s\n\n", gengetopt_args_info_usage);
283 >  if (strlen(gengetopt_args_info_usage) > 0)
284 >    printf("\n%s\n", gengetopt_args_info_usage);
285  
286 +  printf("\n");
287 +
288    if (strlen(gengetopt_args_info_description) > 0)
289 <    printf("%s\n", gengetopt_args_info_description);
289 >    printf("%s\n\n", gengetopt_args_info_description);
290 > }
291  
292 + void
293 + cmdline_parser_print_help (void)
294 + {
295 +  int i = 0;
296 +  print_help_common();
297    while (gengetopt_args_info_help[i])
298      printf("%s\n", gengetopt_args_info_help[i++]);
299   }
# Line 228 | Line 305 | cmdline_parser_init (struct gengetopt_args_info *args_
305    clear_args (args_info);
306    init_args_info (args_info);
307  
308 <  args_info->inputs = NULL;
308 >  args_info->inputs = 0;
309    args_info->inputs_num = 0;
310   }
311  
312 + void
313 + cmdline_parser_params_init(struct cmdline_parser_params *params)
314 + {
315 +  if (params)
316 +    {
317 +      params->override = 0;
318 +      params->initialize = 1;
319 +      params->check_required = 1;
320 +      params->check_ambiguity = 0;
321 +      params->print_errors = 1;
322 +    }
323 + }
324 +
325 + struct cmdline_parser_params *
326 + cmdline_parser_params_create(void)
327 + {
328 +  struct cmdline_parser_params *params =
329 +    (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params));
330 +  cmdline_parser_params_init(params);  
331 +  return params;
332 + }
333 +
334   static void
335 < cmdline_parser_release (struct gengetopt_args_info *args_info)
335 > free_string_field (char **s)
336   {
337 <  
239 <  unsigned int i;
240 <  if (args_info->input_arg)
337 >  if (*s)
338      {
339 <      free (args_info->input_arg); /* free previous argument */
340 <      args_info->input_arg = 0;
339 >      free (*s);
340 >      *s = 0;
341      }
342 <  if (args_info->input_orig)
343 <    {
344 <      free (args_info->input_orig); /* free previous argument */
345 <      args_info->input_orig = 0;
346 <    }
347 <  if (args_info->output_arg)
348 <    {
349 <      free (args_info->output_arg); /* free previous argument */
350 <      args_info->output_arg = 0;
351 <    }
352 <  if (args_info->output_orig)
353 <    {
354 <      free (args_info->output_orig); /* free previous argument */
355 <      args_info->output_orig = 0;
356 <    }
357 <  if (args_info->step_orig)
358 <    {
359 <      free (args_info->step_orig); /* free previous argument */
360 <      args_info->step_orig = 0;
361 <    }
362 <  if (args_info->nbins_orig)
363 <    {
364 <      free (args_info->nbins_orig); /* free previous argument */
365 <      args_info->nbins_orig = 0;
366 <    }
367 <  if (args_info->nbins_x_orig)
368 <    {
369 <      free (args_info->nbins_x_orig); /* free previous argument */
370 <      args_info->nbins_x_orig = 0;
371 <    }
372 <  if (args_info->nbins_y_orig)
373 <    {
374 <      free (args_info->nbins_y_orig); /* free previous argument */
375 <      args_info->nbins_y_orig = 0;
376 <    }
377 <  if (args_info->nanglebins_orig)
378 <    {
282 <      free (args_info->nanglebins_orig); /* free previous argument */
283 <      args_info->nanglebins_orig = 0;
284 <    }
285 <  if (args_info->length_orig)
286 <    {
287 <      free (args_info->length_orig); /* free previous argument */
288 <      args_info->length_orig = 0;
289 <    }
290 <  if (args_info->rcut_orig)
291 <    {
292 <      free (args_info->rcut_orig); /* free previous argument */
293 <      args_info->rcut_orig = 0;
294 <    }
295 <  if (args_info->zoffset_orig)
296 <    {
297 <      free (args_info->zoffset_orig); /* free previous argument */
298 <      args_info->zoffset_orig = 0;
299 <    }
300 <  if (args_info->sele1_arg)
301 <    {
302 <      free (args_info->sele1_arg); /* free previous argument */
303 <      args_info->sele1_arg = 0;
304 <    }
305 <  if (args_info->sele1_orig)
306 <    {
307 <      free (args_info->sele1_orig); /* free previous argument */
308 <      args_info->sele1_orig = 0;
309 <    }
310 <  if (args_info->sele2_arg)
311 <    {
312 <      free (args_info->sele2_arg); /* free previous argument */
313 <      args_info->sele2_arg = 0;
314 <    }
315 <  if (args_info->sele2_orig)
316 <    {
317 <      free (args_info->sele2_orig); /* free previous argument */
318 <      args_info->sele2_orig = 0;
319 <    }
320 <  if (args_info->sele3_arg)
321 <    {
322 <      free (args_info->sele3_arg); /* free previous argument */
323 <      args_info->sele3_arg = 0;
324 <    }
325 <  if (args_info->sele3_orig)
326 <    {
327 <      free (args_info->sele3_orig); /* free previous argument */
328 <      args_info->sele3_orig = 0;
329 <    }
330 <  if (args_info->refsele_arg)
331 <    {
332 <      free (args_info->refsele_arg); /* free previous argument */
333 <      args_info->refsele_arg = 0;
334 <    }
335 <  if (args_info->refsele_orig)
336 <    {
337 <      free (args_info->refsele_orig); /* free previous argument */
338 <      args_info->refsele_orig = 0;
339 <    }
340 <  if (args_info->molname_arg)
341 <    {
342 <      free (args_info->molname_arg); /* free previous argument */
343 <      args_info->molname_arg = 0;
344 <    }
345 <  if (args_info->molname_orig)
346 <    {
347 <      free (args_info->molname_orig); /* free previous argument */
348 <      args_info->molname_orig = 0;
349 <    }
350 <  if (args_info->begin_orig)
351 <    {
352 <      free (args_info->begin_orig); /* free previous argument */
353 <      args_info->begin_orig = 0;
354 <    }
355 <  if (args_info->end_orig)
356 <    {
357 <      free (args_info->end_orig); /* free previous argument */
358 <      args_info->end_orig = 0;
359 <    }
360 <  if (args_info->radius_orig)
361 <    {
362 <      free (args_info->radius_orig); /* free previous argument */
363 <      args_info->radius_orig = 0;
364 <    }
342 > }
343 >
344 >
345 > static void
346 > cmdline_parser_release (struct gengetopt_args_info *args_info)
347 > {
348 >  unsigned int i;
349 >  free_string_field (&(args_info->input_arg));
350 >  free_string_field (&(args_info->input_orig));
351 >  free_string_field (&(args_info->output_arg));
352 >  free_string_field (&(args_info->output_orig));
353 >  free_string_field (&(args_info->step_orig));
354 >  free_string_field (&(args_info->nbins_orig));
355 >  free_string_field (&(args_info->nbins_x_orig));
356 >  free_string_field (&(args_info->nbins_y_orig));
357 >  free_string_field (&(args_info->nbins_z_orig));
358 >  free_string_field (&(args_info->nanglebins_orig));
359 >  free_string_field (&(args_info->rcut_orig));
360 >  free_string_field (&(args_info->dz_orig));
361 >  free_string_field (&(args_info->length_orig));
362 >  free_string_field (&(args_info->zlength_orig));
363 >  free_string_field (&(args_info->zoffset_orig));
364 >  free_string_field (&(args_info->sele1_arg));
365 >  free_string_field (&(args_info->sele1_orig));
366 >  free_string_field (&(args_info->sele2_arg));
367 >  free_string_field (&(args_info->sele2_orig));
368 >  free_string_field (&(args_info->sele3_arg));
369 >  free_string_field (&(args_info->sele3_orig));
370 >  free_string_field (&(args_info->refsele_arg));
371 >  free_string_field (&(args_info->refsele_orig));
372 >  free_string_field (&(args_info->comsele_arg));
373 >  free_string_field (&(args_info->comsele_orig));
374 >  free_string_field (&(args_info->molname_arg));
375 >  free_string_field (&(args_info->molname_orig));
376 >  free_string_field (&(args_info->begin_orig));
377 >  free_string_field (&(args_info->end_orig));
378 >  free_string_field (&(args_info->radius_orig));
379    
380 +  
381    for (i = 0; i < args_info->inputs_num; ++i)
382      free (args_info->inputs [i]);
383 <  
383 >
384    if (args_info->inputs_num)
385      free (args_info->inputs);
386 <  
386 >
387    clear_given (args_info);
388   }
389  
390 +
391 + static void
392 + write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
393 + {
394 +  FIX_UNUSED (values);
395 +  if (arg) {
396 +    fprintf(outfile, "%s=\"%s\"\n", opt, arg);
397 +  } else {
398 +    fprintf(outfile, "%s\n", opt);
399 +  }
400 + }
401 +
402 +
403   int
404 + cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
405 + {
406 +  int i = 0;
407 +
408 +  if (!outfile)
409 +    {
410 +      fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE);
411 +      return EXIT_FAILURE;
412 +    }
413 +
414 +  if (args_info->help_given)
415 +    write_into_file(outfile, "help", 0, 0 );
416 +  if (args_info->version_given)
417 +    write_into_file(outfile, "version", 0, 0 );
418 +  if (args_info->input_given)
419 +    write_into_file(outfile, "input", args_info->input_orig, 0);
420 +  if (args_info->output_given)
421 +    write_into_file(outfile, "output", args_info->output_orig, 0);
422 +  if (args_info->step_given)
423 +    write_into_file(outfile, "step", args_info->step_orig, 0);
424 +  if (args_info->nbins_given)
425 +    write_into_file(outfile, "nbins", args_info->nbins_orig, 0);
426 +  if (args_info->nbins_x_given)
427 +    write_into_file(outfile, "nbins_x", args_info->nbins_x_orig, 0);
428 +  if (args_info->nbins_y_given)
429 +    write_into_file(outfile, "nbins_y", args_info->nbins_y_orig, 0);
430 +  if (args_info->nbins_z_given)
431 +    write_into_file(outfile, "nbins_z", args_info->nbins_z_orig, 0);
432 +  if (args_info->nanglebins_given)
433 +    write_into_file(outfile, "nanglebins", args_info->nanglebins_orig, 0);
434 +  if (args_info->rcut_given)
435 +    write_into_file(outfile, "rcut", args_info->rcut_orig, 0);
436 +  if (args_info->dz_given)
437 +    write_into_file(outfile, "dz", args_info->dz_orig, 0);
438 +  if (args_info->length_given)
439 +    write_into_file(outfile, "length", args_info->length_orig, 0);
440 +  if (args_info->zlength_given)
441 +    write_into_file(outfile, "zlength", args_info->zlength_orig, 0);
442 +  if (args_info->zoffset_given)
443 +    write_into_file(outfile, "zoffset", args_info->zoffset_orig, 0);
444 +  if (args_info->sele1_given)
445 +    write_into_file(outfile, "sele1", args_info->sele1_orig, 0);
446 +  if (args_info->sele2_given)
447 +    write_into_file(outfile, "sele2", args_info->sele2_orig, 0);
448 +  if (args_info->sele3_given)
449 +    write_into_file(outfile, "sele3", args_info->sele3_orig, 0);
450 +  if (args_info->refsele_given)
451 +    write_into_file(outfile, "refsele", args_info->refsele_orig, 0);
452 +  if (args_info->comsele_given)
453 +    write_into_file(outfile, "comsele", args_info->comsele_orig, 0);
454 +  if (args_info->molname_given)
455 +    write_into_file(outfile, "molname", args_info->molname_orig, 0);
456 +  if (args_info->begin_given)
457 +    write_into_file(outfile, "begin", args_info->begin_orig, 0);
458 +  if (args_info->end_given)
459 +    write_into_file(outfile, "end", args_info->end_orig, 0);
460 +  if (args_info->radius_given)
461 +    write_into_file(outfile, "radius", args_info->radius_orig, 0);
462 +  if (args_info->bo_given)
463 +    write_into_file(outfile, "bo", 0, 0 );
464 +  if (args_info->bor_given)
465 +    write_into_file(outfile, "bor", 0, 0 );
466 +  if (args_info->bad_given)
467 +    write_into_file(outfile, "bad", 0, 0 );
468 +  if (args_info->count_given)
469 +    write_into_file(outfile, "count", 0, 0 );
470 +  if (args_info->gofr_given)
471 +    write_into_file(outfile, "gofr", 0, 0 );
472 +  if (args_info->gofz_given)
473 +    write_into_file(outfile, "gofz", 0, 0 );
474 +  if (args_info->r_theta_given)
475 +    write_into_file(outfile, "r_theta", 0, 0 );
476 +  if (args_info->r_omega_given)
477 +    write_into_file(outfile, "r_omega", 0, 0 );
478 +  if (args_info->r_z_given)
479 +    write_into_file(outfile, "r_z", 0, 0 );
480 +  if (args_info->theta_omega_given)
481 +    write_into_file(outfile, "theta_omega", 0, 0 );
482 +  if (args_info->gxyz_given)
483 +    write_into_file(outfile, "gxyz", 0, 0 );
484 +  if (args_info->twodgofr_given)
485 +    write_into_file(outfile, "twodgofr", 0, 0 );
486 +  if (args_info->p2_given)
487 +    write_into_file(outfile, "p2", 0, 0 );
488 +  if (args_info->rp2_given)
489 +    write_into_file(outfile, "rp2", 0, 0 );
490 +  if (args_info->scd_given)
491 +    write_into_file(outfile, "scd", 0, 0 );
492 +  if (args_info->density_given)
493 +    write_into_file(outfile, "density", 0, 0 );
494 +  if (args_info->slab_density_given)
495 +    write_into_file(outfile, "slab_density", 0, 0 );
496 +  if (args_info->p_angle_given)
497 +    write_into_file(outfile, "p_angle", 0, 0 );
498 +  if (args_info->hxy_given)
499 +    write_into_file(outfile, "hxy", 0, 0 );
500 +  if (args_info->rho_r_given)
501 +    write_into_file(outfile, "rho_r", 0, 0 );
502 +  if (args_info->angle_r_given)
503 +    write_into_file(outfile, "angle_r", 0, 0 );
504 +  if (args_info->hullvol_given)
505 +    write_into_file(outfile, "hullvol", 0, 0 );
506 +  if (args_info->rodlength_given)
507 +    write_into_file(outfile, "rodlength", 0, 0 );
508 +  if (args_info->tet_param_given)
509 +    write_into_file(outfile, "tet_param", 0, 0 );
510 +  if (args_info->tet_param_z_given)
511 +    write_into_file(outfile, "tet_param_z", 0, 0 );
512 +  
513 +
514 +  i = EXIT_SUCCESS;
515 +  return i;
516 + }
517 +
518 + int
519   cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
520   {
521    FILE *outfile;
# Line 386 | Line 529 | cmdline_parser_file_save(const char *filename, struct
529        return EXIT_FAILURE;
530      }
531  
532 <  if (args_info->help_given) {
390 <    fprintf(outfile, "%s\n", "help");
391 <  }
392 <  if (args_info->version_given) {
393 <    fprintf(outfile, "%s\n", "version");
394 <  }
395 <  if (args_info->input_given) {
396 <    if (args_info->input_orig) {
397 <      fprintf(outfile, "%s=\"%s\"\n", "input", args_info->input_orig);
398 <    } else {
399 <      fprintf(outfile, "%s\n", "input");
400 <    }
401 <  }
402 <  if (args_info->output_given) {
403 <    if (args_info->output_orig) {
404 <      fprintf(outfile, "%s=\"%s\"\n", "output", args_info->output_orig);
405 <    } else {
406 <      fprintf(outfile, "%s\n", "output");
407 <    }
408 <  }
409 <  if (args_info->step_given) {
410 <    if (args_info->step_orig) {
411 <      fprintf(outfile, "%s=\"%s\"\n", "step", args_info->step_orig);
412 <    } else {
413 <      fprintf(outfile, "%s\n", "step");
414 <    }
415 <  }
416 <  if (args_info->nbins_given) {
417 <    if (args_info->nbins_orig) {
418 <      fprintf(outfile, "%s=\"%s\"\n", "nbins", args_info->nbins_orig);
419 <    } else {
420 <      fprintf(outfile, "%s\n", "nbins");
421 <    }
422 <  }
423 <  if (args_info->nbins_x_given) {
424 <    if (args_info->nbins_x_orig) {
425 <      fprintf(outfile, "%s=\"%s\"\n", "nbins_x", args_info->nbins_x_orig);
426 <    } else {
427 <      fprintf(outfile, "%s\n", "nbins_x");
428 <    }
429 <  }
430 <  if (args_info->nbins_y_given) {
431 <    if (args_info->nbins_y_orig) {
432 <      fprintf(outfile, "%s=\"%s\"\n", "nbins_y", args_info->nbins_y_orig);
433 <    } else {
434 <      fprintf(outfile, "%s\n", "nbins_y");
435 <    }
436 <  }
437 <  if (args_info->nanglebins_given) {
438 <    if (args_info->nanglebins_orig) {
439 <      fprintf(outfile, "%s=\"%s\"\n", "nanglebins", args_info->nanglebins_orig);
440 <    } else {
441 <      fprintf(outfile, "%s\n", "nanglebins");
442 <    }
443 <  }
444 <  if (args_info->length_given) {
445 <    if (args_info->length_orig) {
446 <      fprintf(outfile, "%s=\"%s\"\n", "length", args_info->length_orig);
447 <    } else {
448 <      fprintf(outfile, "%s\n", "length");
449 <    }
450 <  }
451 <  if (args_info->rcut_given) {
452 <    if (args_info->rcut_orig) {
453 <      fprintf(outfile, "%s=\"%s\"\n", "rcut", args_info->rcut_orig);
454 <    } else {
455 <      fprintf(outfile, "%s\n", "rcut");
456 <    }
457 <  }
458 <  if (args_info->zoffset_given) {
459 <    if (args_info->zoffset_orig) {
460 <      fprintf(outfile, "%s=\"%s\"\n", "zoffset", args_info->zoffset_orig);
461 <    } else {
462 <      fprintf(outfile, "%s\n", "zoffset");
463 <    }
464 <  }
465 <  if (args_info->sele1_given) {
466 <    if (args_info->sele1_orig) {
467 <      fprintf(outfile, "%s=\"%s\"\n", "sele1", args_info->sele1_orig);
468 <    } else {
469 <      fprintf(outfile, "%s\n", "sele1");
470 <    }
471 <  }
472 <  if (args_info->sele2_given) {
473 <    if (args_info->sele2_orig) {
474 <      fprintf(outfile, "%s=\"%s\"\n", "sele2", args_info->sele2_orig);
475 <    } else {
476 <      fprintf(outfile, "%s\n", "sele2");
477 <    }
478 <  }
479 <  if (args_info->sele3_given) {
480 <    if (args_info->sele3_orig) {
481 <      fprintf(outfile, "%s=\"%s\"\n", "sele3", args_info->sele3_orig);
482 <    } else {
483 <      fprintf(outfile, "%s\n", "sele3");
484 <    }
485 <  }
486 <  if (args_info->refsele_given) {
487 <    if (args_info->refsele_orig) {
488 <      fprintf(outfile, "%s=\"%s\"\n", "refsele", args_info->refsele_orig);
489 <    } else {
490 <      fprintf(outfile, "%s\n", "refsele");
491 <    }
492 <  }
493 <  if (args_info->molname_given) {
494 <    if (args_info->molname_orig) {
495 <      fprintf(outfile, "%s=\"%s\"\n", "molname", args_info->molname_orig);
496 <    } else {
497 <      fprintf(outfile, "%s\n", "molname");
498 <    }
499 <  }
500 <  if (args_info->begin_given) {
501 <    if (args_info->begin_orig) {
502 <      fprintf(outfile, "%s=\"%s\"\n", "begin", args_info->begin_orig);
503 <    } else {
504 <      fprintf(outfile, "%s\n", "begin");
505 <    }
506 <  }
507 <  if (args_info->end_given) {
508 <    if (args_info->end_orig) {
509 <      fprintf(outfile, "%s=\"%s\"\n", "end", args_info->end_orig);
510 <    } else {
511 <      fprintf(outfile, "%s\n", "end");
512 <    }
513 <  }
514 <  if (args_info->radius_given) {
515 <    if (args_info->radius_orig) {
516 <      fprintf(outfile, "%s=\"%s\"\n", "radius", args_info->radius_orig);
517 <    } else {
518 <      fprintf(outfile, "%s\n", "radius");
519 <    }
520 <  }
521 <  if (args_info->bo_given) {
522 <    fprintf(outfile, "%s\n", "bo");
523 <  }
524 <  if (args_info->bor_given) {
525 <    fprintf(outfile, "%s\n", "bor");
526 <  }
527 <  if (args_info->gofr_given) {
528 <    fprintf(outfile, "%s\n", "gofr");
529 <  }
530 <  if (args_info->r_theta_given) {
531 <    fprintf(outfile, "%s\n", "r_theta");
532 <  }
533 <  if (args_info->r_omega_given) {
534 <    fprintf(outfile, "%s\n", "r_omega");
535 <  }
536 <  if (args_info->theta_omega_given) {
537 <    fprintf(outfile, "%s\n", "theta_omega");
538 <  }
539 <  if (args_info->gxyz_given) {
540 <    fprintf(outfile, "%s\n", "gxyz");
541 <  }
542 <  if (args_info->p2_given) {
543 <    fprintf(outfile, "%s\n", "p2");
544 <  }
545 <  if (args_info->rp2_given) {
546 <    fprintf(outfile, "%s\n", "rp2");
547 <  }
548 <  if (args_info->scd_given) {
549 <    fprintf(outfile, "%s\n", "scd");
550 <  }
551 <  if (args_info->density_given) {
552 <    fprintf(outfile, "%s\n", "density");
553 <  }
554 <  if (args_info->slab_density_given) {
555 <    fprintf(outfile, "%s\n", "slab_density");
556 <  }
557 <  if (args_info->hxy_given) {
558 <    fprintf(outfile, "%s\n", "hxy");
559 <  }
560 <  if (args_info->rho_r_given) {
561 <    fprintf(outfile, "%s\n", "rho_r");
562 <  }
563 <  
532 >  i = cmdline_parser_dump(outfile, args_info);
533    fclose (outfile);
534  
566  i = EXIT_SUCCESS;
535    return i;
536   }
537  
# Line 573 | Line 541 | cmdline_parser_free (struct gengetopt_args_info *args_
541    cmdline_parser_release (args_info);
542   }
543  
544 <
577 < /* gengetopt_strdup() */
578 < /* strdup.c replacement of strdup, which is not standard */
544 > /** @brief replacement of strdup, which is not standard */
545   char *
546   gengetopt_strdup (const char *s)
547   {
548 <  char *result = NULL;
548 >  char *result = 0;
549    if (!s)
550      return result;
551  
# Line 591 | Line 557 | static void
557   }
558  
559   static void
594 reset_group_staticProps(struct gengetopt_args_info *args_info);
595
596 static void
560   reset_group_staticProps(struct gengetopt_args_info *args_info)
561   {
562    if (! args_info->staticProps_group_counter)
# Line 601 | Line 564 | reset_group_staticProps(struct gengetopt_args_info *ar
564    
565    args_info->bo_given = 0 ;
566    args_info->bor_given = 0 ;
567 +  args_info->bad_given = 0 ;
568 +  args_info->count_given = 0 ;
569    args_info->gofr_given = 0 ;
570 +  args_info->gofz_given = 0 ;
571    args_info->r_theta_given = 0 ;
572    args_info->r_omega_given = 0 ;
573 +  args_info->r_z_given = 0 ;
574    args_info->theta_omega_given = 0 ;
575    args_info->gxyz_given = 0 ;
576 +  args_info->twodgofr_given = 0 ;
577    args_info->p2_given = 0 ;
578    args_info->rp2_given = 0 ;
579    args_info->scd_given = 0 ;
580    args_info->density_given = 0 ;
581    args_info->slab_density_given = 0 ;
582 +  args_info->p_angle_given = 0 ;
583    args_info->hxy_given = 0 ;
584    args_info->rho_r_given = 0 ;
585 +  args_info->angle_r_given = 0 ;
586 +  args_info->hullvol_given = 0 ;
587 +  args_info->rodlength_given = 0 ;
588 +  args_info->tet_param_given = 0 ;
589 +  args_info->tet_param_z_given = 0 ;
590  
591    args_info->staticProps_group_counter = 0;
592   }
593  
594   int
595 < cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
595 > cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
596   {
597    return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
598   }
599  
600   int
601 < cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
601 > cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
602 >                   struct cmdline_parser_params *params)
603   {
604    int result;
605 +  result = cmdline_parser_internal (argc, argv, args_info, params, 0);
606  
607 <  result = cmdline_parser_internal (argc, argv, args_info, override, initialize, check_required, NULL);
607 >  if (result == EXIT_FAILURE)
608 >    {
609 >      cmdline_parser_free (args_info);
610 >      exit (EXIT_FAILURE);
611 >    }
612 >  
613 >  return result;
614 > }
615  
616 + int
617 + cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
618 + {
619 +  int result;
620 +  struct cmdline_parser_params params;
621 +  
622 +  params.override = override;
623 +  params.initialize = initialize;
624 +  params.check_required = check_required;
625 +  params.check_ambiguity = 0;
626 +  params.print_errors = 1;
627 +
628 +  result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
629 +
630    if (result == EXIT_FAILURE)
631      {
632        cmdline_parser_free (args_info);
# Line 644 | Line 641 | cmdline_parser_required (struct gengetopt_args_info *a
641   {
642    int result = EXIT_SUCCESS;
643  
644 <  if (cmdline_parser_required2(args_info, prog_name, NULL) > 0)
644 >  if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
645      result = EXIT_FAILURE;
646  
647    if (result == EXIT_FAILURE)
# Line 660 | Line 657 | cmdline_parser_required2 (struct gengetopt_args_info *
657   cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
658   {
659    int error = 0;
660 +  FIX_UNUSED (additional_error);
661  
662    /* checks for required options */
663    if (! args_info->input_given)
# Line 670 | Line 668 | cmdline_parser_required2 (struct gengetopt_args_info *
668    
669    if (args_info->staticProps_group_counter == 0)
670      {
671 <      fprintf (stderr, "%s: %d options of group staticProps were given. One is required.%s\n", prog_name, args_info->staticProps_group_counter, (additional_error ? additional_error : ""));
671 >      fprintf (stderr, "%s: %d options of group staticProps were given. One is required%s.\n", prog_name, args_info->staticProps_group_counter, (additional_error ? additional_error : ""));
672        error = 1;
673      }
674    
# Line 680 | Line 678 | cmdline_parser_required2 (struct gengetopt_args_info *
678    return error;
679   }
680  
681 +
682 + static char *package_name = 0;
683 +
684 + /**
685 + * @brief updates an option
686 + * @param field the generic pointer to the field to update
687 + * @param orig_field the pointer to the orig field
688 + * @param field_given the pointer to the number of occurrence of this option
689 + * @param prev_given the pointer to the number of occurrence already seen
690 + * @param value the argument for this option (if null no arg was specified)
691 + * @param possible_values the possible values for this option (if specified)
692 + * @param default_value the default value (in case the option only accepts fixed values)
693 + * @param arg_type the type of this option
694 + * @param check_ambiguity @see cmdline_parser_params.check_ambiguity
695 + * @param override @see cmdline_parser_params.override
696 + * @param no_free whether to free a possible previous value
697 + * @param multiple_option whether this is a multiple option
698 + * @param long_opt the corresponding long option
699 + * @param short_opt the corresponding short option (or '-' if none)
700 + * @param additional_error possible further error specification
701 + */
702 + static
703 + int update_arg(void *field, char **orig_field,
704 +               unsigned int *field_given, unsigned int *prev_given,
705 +               char *value, const char *possible_values[],
706 +               const char *default_value,
707 +               cmdline_parser_arg_type arg_type,
708 +               int check_ambiguity, int override,
709 +               int no_free, int multiple_option,
710 +               const char *long_opt, char short_opt,
711 +               const char *additional_error)
712 + {
713 +  char *stop_char = 0;
714 +  const char *val = value;
715 +  int found;
716 +  char **string_field;
717 +  FIX_UNUSED (field);
718 +
719 +  stop_char = 0;
720 +  found = 0;
721 +
722 +  if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given)))
723 +    {
724 +      if (short_opt != '-')
725 +        fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n",
726 +               package_name, long_opt, short_opt,
727 +               (additional_error ? additional_error : ""));
728 +      else
729 +        fprintf (stderr, "%s: `--%s' option given more than once%s\n",
730 +               package_name, long_opt,
731 +               (additional_error ? additional_error : ""));
732 +      return 1; /* failure */
733 +    }
734 +
735 +  FIX_UNUSED (default_value);
736 +    
737 +  if (field_given && *field_given && ! override)
738 +    return 0;
739 +  if (prev_given)
740 +    (*prev_given)++;
741 +  if (field_given)
742 +    (*field_given)++;
743 +  if (possible_values)
744 +    val = possible_values[found];
745 +
746 +  switch(arg_type) {
747 +  case ARG_INT:
748 +    if (val) *((int *)field) = strtol (val, &stop_char, 0);
749 +    break;
750 +  case ARG_DOUBLE:
751 +    if (val) *((double *)field) = strtod (val, &stop_char);
752 +    break;
753 +  case ARG_STRING:
754 +    if (val) {
755 +      string_field = (char **)field;
756 +      if (!no_free && *string_field)
757 +        free (*string_field); /* free previous string */
758 +      *string_field = gengetopt_strdup (val);
759 +    }
760 +    break;
761 +  default:
762 +    break;
763 +  };
764 +
765 +  /* check numeric conversion */
766 +  switch(arg_type) {
767 +  case ARG_INT:
768 +  case ARG_DOUBLE:
769 +    if (val && !(stop_char && *stop_char == '\0')) {
770 +      fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val);
771 +      return 1; /* failure */
772 +    }
773 +    break;
774 +  default:
775 +    ;
776 +  };
777 +
778 +  /* store the original value */
779 +  switch(arg_type) {
780 +  case ARG_NO:
781 +    break;
782 +  default:
783 +    if (value && orig_field) {
784 +      if (no_free) {
785 +        *orig_field = value;
786 +      } else {
787 +        if (*orig_field)
788 +          free (*orig_field); /* free previous string */
789 +        *orig_field = gengetopt_strdup (value);
790 +      }
791 +    }
792 +  };
793 +
794 +  return 0; /* OK */
795 + }
796 +
797 +
798   int
799 < cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required, const char *additional_error)
799 > cmdline_parser_internal (
800 >  int argc, char **argv, struct gengetopt_args_info *args_info,
801 >                        struct cmdline_parser_params *params, const char *additional_error)
802   {
803    int c;        /* Character of the parsed option.  */
804  
805    int error = 0;
806    struct gengetopt_args_info local_args_info;
807 +  
808 +  int override;
809 +  int initialize;
810 +  int check_required;
811 +  int check_ambiguity;
812 +  
813 +  package_name = argv[0];
814 +  
815 +  override = params->override;
816 +  initialize = params->initialize;
817 +  check_required = params->check_required;
818 +  check_ambiguity = params->check_ambiguity;
819  
820    if (initialize)
821      cmdline_parser_init (args_info);
# Line 695 | Line 824 | cmdline_parser_internal (int argc, char * const *argv,
824  
825    optarg = 0;
826    optind = 0;
827 <  opterr = 1;
827 >  opterr = params->print_errors;
828    optopt = '?';
829  
830    while (1)
831      {
832        int option_index = 0;
704      char *stop_char;
833  
834        static struct option long_options[] = {
835          { "help",       0, NULL, 'h' },
# Line 712 | Line 840 | cmdline_parser_internal (int argc, char * const *argv,
840          { "nbins",      1, NULL, 'b' },
841          { "nbins_x",    1, NULL, 'x' },
842          { "nbins_y",    1, NULL, 'y' },
843 +        { "nbins_z",    1, NULL, 0 },
844          { "nanglebins", 1, NULL, 'a' },
716        { "length",     1, NULL, 0 },
845          { "rcut",       1, NULL, 'c' },
846 +        { "dz", 1, NULL, 0 },
847 +        { "length",     1, NULL, 0 },
848 +        { "zlength",    1, NULL, 0 },
849          { "zoffset",    1, NULL, 'z' },
850          { "sele1",      1, NULL, 0 },
851          { "sele2",      1, NULL, 0 },
852          { "sele3",      1, NULL, 0 },
853          { "refsele",    1, NULL, 0 },
854 +        { "comsele",    1, NULL, 0 },
855          { "molname",    1, NULL, 0 },
856          { "begin",      1, NULL, 0 },
857          { "end",        1, NULL, 0 },
858          { "radius",     1, NULL, 0 },
859          { "bo", 0, NULL, 0 },
860          { "bor",        0, NULL, 0 },
861 +        { "bad",        0, NULL, 0 },
862 +        { "count",      0, NULL, 0 },
863          { "gofr",       0, NULL, 'g' },
864 +        { "gofz",       0, NULL, 0 },
865          { "r_theta",    0, NULL, 0 },
866          { "r_omega",    0, NULL, 0 },
867 +        { "r_z",        0, NULL, 0 },
868          { "theta_omega",        0, NULL, 0 },
869          { "gxyz",       0, NULL, 0 },
870 +        { "twodgofr",   0, NULL, 0 },
871          { "p2", 0, NULL, 'p' },
872          { "rp2",        0, NULL, 0 },
873          { "scd",        0, NULL, 's' },
874          { "density",    0, NULL, 'd' },
875          { "slab_density",       0, NULL, 0 },
876 +        { "p_angle",    0, NULL, 0 },
877          { "hxy",        0, NULL, 0 },
878          { "rho_r",      0, NULL, 0 },
879 <        { NULL, 0, NULL, 0 }
879 >        { "angle_r",    0, NULL, 0 },
880 >        { "hullvol",    0, NULL, 0 },
881 >        { "rodlength",  0, NULL, 0 },
882 >        { "tet_param",  0, NULL, 'Q' },
883 >        { "tet_param_z",        0, NULL, 0 },
884 >        { 0,  0, 0, 0 }
885        };
886  
887 <      stop_char = 0;
745 <      c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index);
887 >      c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsdQ", long_options, &option_index);
888  
889        if (c == -1) break;       /* Exit from `while (1)' loop.  */
890  
# Line 759 | Line 901 | cmdline_parser_internal (int argc, char * const *argv,
901            exit (EXIT_SUCCESS);
902  
903          case 'i':       /* input dump file.  */
904 <          if (local_args_info.input_given)
905 <            {
906 <              fprintf (stderr, "%s: `--input' (`-i') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
907 <              goto failure;
908 <            }
909 <          if (args_info->input_given && ! override)
910 <            continue;
911 <          local_args_info.input_given = 1;
912 <          args_info->input_given = 1;
913 <          if (args_info->input_arg)
772 <            free (args_info->input_arg); /* free previous string */
773 <          args_info->input_arg = gengetopt_strdup (optarg);
774 <          if (args_info->input_orig)
775 <            free (args_info->input_orig); /* free previous string */
776 <          args_info->input_orig = gengetopt_strdup (optarg);
904 >        
905 >        
906 >          if (update_arg( (void *)&(args_info->input_arg),
907 >               &(args_info->input_orig), &(args_info->input_given),
908 >              &(local_args_info.input_given), optarg, 0, 0, ARG_STRING,
909 >              check_ambiguity, override, 0, 0,
910 >              "input", 'i',
911 >              additional_error))
912 >            goto failure;
913 >        
914            break;
778
915          case 'o':       /* output file name.  */
916 <          if (local_args_info.output_given)
917 <            {
918 <              fprintf (stderr, "%s: `--output' (`-o') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
919 <              goto failure;
920 <            }
921 <          if (args_info->output_given && ! override)
922 <            continue;
923 <          local_args_info.output_given = 1;
924 <          args_info->output_given = 1;
925 <          if (args_info->output_arg)
790 <            free (args_info->output_arg); /* free previous string */
791 <          args_info->output_arg = gengetopt_strdup (optarg);
792 <          if (args_info->output_orig)
793 <            free (args_info->output_orig); /* free previous string */
794 <          args_info->output_orig = gengetopt_strdup (optarg);
916 >        
917 >        
918 >          if (update_arg( (void *)&(args_info->output_arg),
919 >               &(args_info->output_orig), &(args_info->output_given),
920 >              &(local_args_info.output_given), optarg, 0, 0, ARG_STRING,
921 >              check_ambiguity, override, 0, 0,
922 >              "output", 'o',
923 >              additional_error))
924 >            goto failure;
925 >        
926            break;
796
927          case 'n':       /* process every n frame.  */
928 <          if (local_args_info.step_given)
929 <            {
930 <              fprintf (stderr, "%s: `--step' (`-n') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
931 <              goto failure;
932 <            }
933 <          if (args_info->step_given && ! override)
934 <            continue;
935 <          local_args_info.step_given = 1;
806 <          args_info->step_given = 1;
807 <          args_info->step_arg = strtol (optarg, &stop_char, 0);
808 <          if (!(stop_char && *stop_char == '\0')) {
809 <            fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
928 >        
929 >        
930 >          if (update_arg( (void *)&(args_info->step_arg),
931 >               &(args_info->step_orig), &(args_info->step_given),
932 >              &(local_args_info.step_given), optarg, 0, "1", ARG_INT,
933 >              check_ambiguity, override, 0, 0,
934 >              "step", 'n',
935 >              additional_error))
936              goto failure;
937 <          }
812 <          if (args_info->step_orig)
813 <            free (args_info->step_orig); /* free previous string */
814 <          args_info->step_orig = gengetopt_strdup (optarg);
937 >        
938            break;
816
939          case 'b':       /* number of bins (general purpose).  */
940 <          if (local_args_info.nbins_given)
941 <            {
942 <              fprintf (stderr, "%s: `--nbins' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
943 <              goto failure;
944 <            }
945 <          if (args_info->nbins_given && ! override)
946 <            continue;
947 <          local_args_info.nbins_given = 1;
826 <          args_info->nbins_given = 1;
827 <          args_info->nbins_arg = strtol (optarg, &stop_char, 0);
828 <          if (!(stop_char && *stop_char == '\0')) {
829 <            fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
940 >        
941 >        
942 >          if (update_arg( (void *)&(args_info->nbins_arg),
943 >               &(args_info->nbins_orig), &(args_info->nbins_given),
944 >              &(local_args_info.nbins_given), optarg, 0, "100", ARG_INT,
945 >              check_ambiguity, override, 0, 0,
946 >              "nbins", 'b',
947 >              additional_error))
948              goto failure;
949 <          }
832 <          if (args_info->nbins_orig)
833 <            free (args_info->nbins_orig); /* free previous string */
834 <          args_info->nbins_orig = gengetopt_strdup (optarg);
949 >        
950            break;
836
951          case 'x':       /* number of bins in x axis.  */
952 <          if (local_args_info.nbins_x_given)
953 <            {
954 <              fprintf (stderr, "%s: `--nbins_x' (`-x') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
955 <              goto failure;
956 <            }
957 <          if (args_info->nbins_x_given && ! override)
958 <            continue;
959 <          local_args_info.nbins_x_given = 1;
846 <          args_info->nbins_x_given = 1;
847 <          args_info->nbins_x_arg = strtol (optarg, &stop_char, 0);
848 <          if (!(stop_char && *stop_char == '\0')) {
849 <            fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
952 >        
953 >        
954 >          if (update_arg( (void *)&(args_info->nbins_x_arg),
955 >               &(args_info->nbins_x_orig), &(args_info->nbins_x_given),
956 >              &(local_args_info.nbins_x_given), optarg, 0, "100", ARG_INT,
957 >              check_ambiguity, override, 0, 0,
958 >              "nbins_x", 'x',
959 >              additional_error))
960              goto failure;
961 <          }
852 <          if (args_info->nbins_x_orig)
853 <            free (args_info->nbins_x_orig); /* free previous string */
854 <          args_info->nbins_x_orig = gengetopt_strdup (optarg);
961 >        
962            break;
856
963          case 'y':       /* number of bins in y axis.  */
964 <          if (local_args_info.nbins_y_given)
965 <            {
966 <              fprintf (stderr, "%s: `--nbins_y' (`-y') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
967 <              goto failure;
968 <            }
969 <          if (args_info->nbins_y_given && ! override)
970 <            continue;
971 <          local_args_info.nbins_y_given = 1;
866 <          args_info->nbins_y_given = 1;
867 <          args_info->nbins_y_arg = strtol (optarg, &stop_char, 0);
868 <          if (!(stop_char && *stop_char == '\0')) {
869 <            fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
964 >        
965 >        
966 >          if (update_arg( (void *)&(args_info->nbins_y_arg),
967 >               &(args_info->nbins_y_orig), &(args_info->nbins_y_given),
968 >              &(local_args_info.nbins_y_given), optarg, 0, "100", ARG_INT,
969 >              check_ambiguity, override, 0, 0,
970 >              "nbins_y", 'y',
971 >              additional_error))
972              goto failure;
973 <          }
872 <          if (args_info->nbins_y_orig)
873 <            free (args_info->nbins_y_orig); /* free previous string */
874 <          args_info->nbins_y_orig = gengetopt_strdup (optarg);
973 >        
974            break;
876
975          case 'a':       /* number of bins for cos(angle).  */
976 <          if (local_args_info.nanglebins_given)
977 <            {
978 <              fprintf (stderr, "%s: `--nanglebins' (`-a') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
979 <              goto failure;
980 <            }
981 <          if (args_info->nanglebins_given && ! override)
982 <            continue;
983 <          local_args_info.nanglebins_given = 1;
886 <          args_info->nanglebins_given = 1;
887 <          args_info->nanglebins_arg = strtol (optarg, &stop_char, 0);
888 <          if (!(stop_char && *stop_char == '\0')) {
889 <            fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
976 >        
977 >        
978 >          if (update_arg( (void *)&(args_info->nanglebins_arg),
979 >               &(args_info->nanglebins_orig), &(args_info->nanglebins_given),
980 >              &(local_args_info.nanglebins_given), optarg, 0, "50", ARG_INT,
981 >              check_ambiguity, override, 0, 0,
982 >              "nanglebins", 'a',
983 >              additional_error))
984              goto failure;
985 <          }
892 <          if (args_info->nanglebins_orig)
893 <            free (args_info->nanglebins_orig); /* free previous string */
894 <          args_info->nanglebins_orig = gengetopt_strdup (optarg);
985 >        
986            break;
896
987          case 'c':       /* cutoff radius (rcut).  */
988 <          if (local_args_info.rcut_given)
989 <            {
990 <              fprintf (stderr, "%s: `--rcut' (`-c') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
991 <              goto failure;
992 <            }
993 <          if (args_info->rcut_given && ! override)
994 <            continue;
995 <          local_args_info.rcut_given = 1;
906 <          args_info->rcut_given = 1;
907 <          args_info->rcut_arg = strtod (optarg, &stop_char);
908 <          if (!(stop_char && *stop_char == '\0')) {
909 <            fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
988 >        
989 >        
990 >          if (update_arg( (void *)&(args_info->rcut_arg),
991 >               &(args_info->rcut_orig), &(args_info->rcut_given),
992 >              &(local_args_info.rcut_given), optarg, 0, 0, ARG_DOUBLE,
993 >              check_ambiguity, override, 0, 0,
994 >              "rcut", 'c',
995 >              additional_error))
996              goto failure;
997 <          }
912 <          if (args_info->rcut_orig)
913 <            free (args_info->rcut_orig); /* free previous string */
914 <          args_info->rcut_orig = gengetopt_strdup (optarg);
997 >        
998            break;
916
999          case 'z':       /* Where to set the zero for the slab_density calculation.  */
1000 <          if (local_args_info.zoffset_given)
1001 <            {
1002 <              fprintf (stderr, "%s: `--zoffset' (`-z') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1003 <              goto failure;
1004 <            }
1005 <          if (args_info->zoffset_given && ! override)
1006 <            continue;
1007 <          local_args_info.zoffset_given = 1;
926 <          args_info->zoffset_given = 1;
927 <          args_info->zoffset_arg = strtod (optarg, &stop_char);
928 <          if (!(stop_char && *stop_char == '\0')) {
929 <            fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
1000 >        
1001 >        
1002 >          if (update_arg( (void *)&(args_info->zoffset_arg),
1003 >               &(args_info->zoffset_orig), &(args_info->zoffset_given),
1004 >              &(local_args_info.zoffset_given), optarg, 0, "0", ARG_DOUBLE,
1005 >              check_ambiguity, override, 0, 0,
1006 >              "zoffset", 'z',
1007 >              additional_error))
1008              goto failure;
1009 <          }
932 <          if (args_info->zoffset_orig)
933 <            free (args_info->zoffset_orig); /* free previous string */
934 <          args_info->zoffset_orig = gengetopt_strdup (optarg);
1009 >        
1010            break;
936
1011          case 'g':       /* g(r).  */
1012 <          if (local_args_info.gofr_given)
939 <            {
940 <              fprintf (stderr, "%s: `--gofr' (`-g') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
941 <              goto failure;
942 <            }
943 <          if (args_info->gofr_given && ! override)
944 <            continue;
945 <          local_args_info.gofr_given = 1;
946 <          args_info->gofr_given = 1;
1012 >        
1013            if (args_info->staticProps_group_counter && override)
1014              reset_group_staticProps (args_info);
1015            args_info->staticProps_group_counter += 1;
1016 +        
1017 +          if (update_arg( 0 ,
1018 +               0 , &(args_info->gofr_given),
1019 +              &(local_args_info.gofr_given), optarg, 0, 0, ARG_NO,
1020 +              check_ambiguity, override, 0, 0,
1021 +              "gofr", 'g',
1022 +              additional_error))
1023 +            goto failure;
1024 +        
1025            break;
1026 <
1027 <        case 'p':       /* p2 order parameter (--sele1 and --sele2 must be specified).  */
953 <          if (local_args_info.p2_given)
954 <            {
955 <              fprintf (stderr, "%s: `--p2' (`-p') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
956 <              goto failure;
957 <            }
958 <          if (args_info->p2_given && ! override)
959 <            continue;
960 <          local_args_info.p2_given = 1;
961 <          args_info->p2_given = 1;
1026 >        case 'p':       /* p2 order parameter (--sele1 must be specified, --sele2 is optional).  */
1027 >        
1028            if (args_info->staticProps_group_counter && override)
1029              reset_group_staticProps (args_info);
1030            args_info->staticProps_group_counter += 1;
1031 +        
1032 +          if (update_arg( 0 ,
1033 +               0 , &(args_info->p2_given),
1034 +              &(local_args_info.p2_given), optarg, 0, 0, ARG_NO,
1035 +              check_ambiguity, override, 0, 0,
1036 +              "p2", 'p',
1037 +              additional_error))
1038 +            goto failure;
1039 +        
1040            break;
966
1041          case 's':       /* scd order parameter (either --sele1, --sele2, --sele3 are specified or --molname, --begin, --end are specified).  */
1042 <          if (local_args_info.scd_given)
969 <            {
970 <              fprintf (stderr, "%s: `--scd' (`-s') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
971 <              goto failure;
972 <            }
973 <          if (args_info->scd_given && ! override)
974 <            continue;
975 <          local_args_info.scd_given = 1;
976 <          args_info->scd_given = 1;
1042 >        
1043            if (args_info->staticProps_group_counter && override)
1044              reset_group_staticProps (args_info);
1045            args_info->staticProps_group_counter += 1;
1046 +        
1047 +          if (update_arg( 0 ,
1048 +               0 , &(args_info->scd_given),
1049 +              &(local_args_info.scd_given), optarg, 0, 0, ARG_NO,
1050 +              check_ambiguity, override, 0, 0,
1051 +              "scd", 's',
1052 +              additional_error))
1053 +            goto failure;
1054 +        
1055            break;
981
1056          case 'd':       /* density plot.  */
1057 <          if (local_args_info.density_given)
1058 <            {
1059 <              fprintf (stderr, "%s: `--density' (`-d') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1060 <              goto failure;
1061 <            }
1062 <          if (args_info->density_given && ! override)
1063 <            continue;
1064 <          local_args_info.density_given = 1;
1065 <          args_info->density_given = 1;
1057 >        
1058 >          if (args_info->staticProps_group_counter && override)
1059 >            reset_group_staticProps (args_info);
1060 >          args_info->staticProps_group_counter += 1;
1061 >        
1062 >          if (update_arg( 0 ,
1063 >               0 , &(args_info->density_given),
1064 >              &(local_args_info.density_given), optarg, 0, 0, ARG_NO,
1065 >              check_ambiguity, override, 0, 0,
1066 >              "density", 'd',
1067 >              additional_error))
1068 >            goto failure;
1069 >        
1070 >          break;
1071 >        case 'Q':       /* tetrahedrality order parameter.  */
1072 >        
1073            if (args_info->staticProps_group_counter && override)
1074              reset_group_staticProps (args_info);
1075            args_info->staticProps_group_counter += 1;
1076 +        
1077 +          if (update_arg( 0 ,
1078 +               0 , &(args_info->tet_param_given),
1079 +              &(local_args_info.tet_param_given), optarg, 0, 0, ARG_NO,
1080 +              check_ambiguity, override, 0, 0,
1081 +              "tet_param", 'Q',
1082 +              additional_error))
1083 +            goto failure;
1084 +        
1085            break;
1086  
997
1087          case 0: /* Long option with no short option */
1088 +          /* number of bins in z axis.  */
1089 +          if (strcmp (long_options[option_index].name, "nbins_z") == 0)
1090 +          {
1091 +          
1092 +          
1093 +            if (update_arg( (void *)&(args_info->nbins_z_arg),
1094 +                 &(args_info->nbins_z_orig), &(args_info->nbins_z_given),
1095 +                &(local_args_info.nbins_z_given), optarg, 0, "100", ARG_INT,
1096 +                check_ambiguity, override, 0, 0,
1097 +                "nbins_z", '-',
1098 +                additional_error))
1099 +              goto failure;
1100 +          
1101 +          }
1102 +          /* slab width (dz).  */
1103 +          else if (strcmp (long_options[option_index].name, "dz") == 0)
1104 +          {
1105 +          
1106 +          
1107 +            if (update_arg( (void *)&(args_info->dz_arg),
1108 +                 &(args_info->dz_orig), &(args_info->dz_given),
1109 +                &(local_args_info.dz_given), optarg, 0, 0, ARG_DOUBLE,
1110 +                check_ambiguity, override, 0, 0,
1111 +                "dz", '-',
1112 +                additional_error))
1113 +              goto failure;
1114 +          
1115 +          }
1116            /* maximum length (Defaults to 1/2 smallest length of first frame).  */
1117 <          if (strcmp (long_options[option_index].name, "length") == 0)
1117 >          else if (strcmp (long_options[option_index].name, "length") == 0)
1118            {
1119 <            if (local_args_info.length_given)
1120 <              {
1121 <                fprintf (stderr, "%s: `--length' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1122 <                goto failure;
1123 <              }
1124 <            if (args_info->length_given && ! override)
1125 <              continue;
1126 <            local_args_info.length_given = 1;
1010 <            args_info->length_given = 1;
1011 <            args_info->length_arg = strtod (optarg, &stop_char);
1012 <            if (!(stop_char && *stop_char == '\0')) {
1013 <              fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
1119 >          
1120 >          
1121 >            if (update_arg( (void *)&(args_info->length_arg),
1122 >                 &(args_info->length_orig), &(args_info->length_given),
1123 >                &(local_args_info.length_given), optarg, 0, 0, ARG_DOUBLE,
1124 >                check_ambiguity, override, 0, 0,
1125 >                "length", '-',
1126 >                additional_error))
1127                goto failure;
1128 <            }
1016 <            if (args_info->length_orig)
1017 <              free (args_info->length_orig); /* free previous string */
1018 <            args_info->length_orig = gengetopt_strdup (optarg);
1128 >          
1129            }
1130 +          /* maximum length (Defaults to 1/2 smallest length of first frame).  */
1131 +          else if (strcmp (long_options[option_index].name, "zlength") == 0)
1132 +          {
1133 +          
1134 +          
1135 +            if (update_arg( (void *)&(args_info->zlength_arg),
1136 +                 &(args_info->zlength_orig), &(args_info->zlength_given),
1137 +                &(local_args_info.zlength_given), optarg, 0, 0, ARG_DOUBLE,
1138 +                check_ambiguity, override, 0, 0,
1139 +                "zlength", '-',
1140 +                additional_error))
1141 +              goto failure;
1142 +          
1143 +          }
1144            /* select the first stuntdouble set.  */
1145            else if (strcmp (long_options[option_index].name, "sele1") == 0)
1146            {
1147 <            if (local_args_info.sele1_given)
1148 <              {
1149 <                fprintf (stderr, "%s: `--sele1' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1150 <                goto failure;
1151 <              }
1152 <            if (args_info->sele1_given && ! override)
1153 <              continue;
1154 <            local_args_info.sele1_given = 1;
1155 <            args_info->sele1_given = 1;
1156 <            if (args_info->sele1_arg)
1033 <              free (args_info->sele1_arg); /* free previous string */
1034 <            args_info->sele1_arg = gengetopt_strdup (optarg);
1035 <            if (args_info->sele1_orig)
1036 <              free (args_info->sele1_orig); /* free previous string */
1037 <            args_info->sele1_orig = gengetopt_strdup (optarg);
1147 >          
1148 >          
1149 >            if (update_arg( (void *)&(args_info->sele1_arg),
1150 >                 &(args_info->sele1_orig), &(args_info->sele1_given),
1151 >                &(local_args_info.sele1_given), optarg, 0, 0, ARG_STRING,
1152 >                check_ambiguity, override, 0, 0,
1153 >                "sele1", '-',
1154 >                additional_error))
1155 >              goto failure;
1156 >          
1157            }
1158            /* select the second stuntdouble set.  */
1159            else if (strcmp (long_options[option_index].name, "sele2") == 0)
1160            {
1161 <            if (local_args_info.sele2_given)
1162 <              {
1163 <                fprintf (stderr, "%s: `--sele2' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1164 <                goto failure;
1165 <              }
1166 <            if (args_info->sele2_given && ! override)
1167 <              continue;
1168 <            local_args_info.sele2_given = 1;
1169 <            args_info->sele2_given = 1;
1170 <            if (args_info->sele2_arg)
1052 <              free (args_info->sele2_arg); /* free previous string */
1053 <            args_info->sele2_arg = gengetopt_strdup (optarg);
1054 <            if (args_info->sele2_orig)
1055 <              free (args_info->sele2_orig); /* free previous string */
1056 <            args_info->sele2_orig = gengetopt_strdup (optarg);
1161 >          
1162 >          
1163 >            if (update_arg( (void *)&(args_info->sele2_arg),
1164 >                 &(args_info->sele2_orig), &(args_info->sele2_given),
1165 >                &(local_args_info.sele2_given), optarg, 0, 0, ARG_STRING,
1166 >                check_ambiguity, override, 0, 0,
1167 >                "sele2", '-',
1168 >                additional_error))
1169 >              goto failure;
1170 >          
1171            }
1172            /* select the third stuntdouble set.  */
1173            else if (strcmp (long_options[option_index].name, "sele3") == 0)
1174            {
1175 <            if (local_args_info.sele3_given)
1176 <              {
1177 <                fprintf (stderr, "%s: `--sele3' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1178 <                goto failure;
1179 <              }
1180 <            if (args_info->sele3_given && ! override)
1181 <              continue;
1182 <            local_args_info.sele3_given = 1;
1183 <            args_info->sele3_given = 1;
1184 <            if (args_info->sele3_arg)
1071 <              free (args_info->sele3_arg); /* free previous string */
1072 <            args_info->sele3_arg = gengetopt_strdup (optarg);
1073 <            if (args_info->sele3_orig)
1074 <              free (args_info->sele3_orig); /* free previous string */
1075 <            args_info->sele3_orig = gengetopt_strdup (optarg);
1175 >          
1176 >          
1177 >            if (update_arg( (void *)&(args_info->sele3_arg),
1178 >                 &(args_info->sele3_orig), &(args_info->sele3_given),
1179 >                &(local_args_info.sele3_given), optarg, 0, 0, ARG_STRING,
1180 >                check_ambiguity, override, 0, 0,
1181 >                "sele3", '-',
1182 >                additional_error))
1183 >              goto failure;
1184 >          
1185            }
1186            /* select reference (use and only use with --gxyz).  */
1187            else if (strcmp (long_options[option_index].name, "refsele") == 0)
1188            {
1189 <            if (local_args_info.refsele_given)
1190 <              {
1191 <                fprintf (stderr, "%s: `--refsele' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1192 <                goto failure;
1193 <              }
1194 <            if (args_info->refsele_given && ! override)
1195 <              continue;
1196 <            local_args_info.refsele_given = 1;
1197 <            args_info->refsele_given = 1;
1198 <            if (args_info->refsele_arg)
1090 <              free (args_info->refsele_arg); /* free previous string */
1091 <            args_info->refsele_arg = gengetopt_strdup (optarg);
1092 <            if (args_info->refsele_orig)
1093 <              free (args_info->refsele_orig); /* free previous string */
1094 <            args_info->refsele_orig = gengetopt_strdup (optarg);
1189 >          
1190 >          
1191 >            if (update_arg( (void *)&(args_info->refsele_arg),
1192 >                 &(args_info->refsele_orig), &(args_info->refsele_given),
1193 >                &(local_args_info.refsele_given), optarg, 0, 0, ARG_STRING,
1194 >                check_ambiguity, override, 0, 0,
1195 >                "refsele", '-',
1196 >                additional_error))
1197 >              goto failure;
1198 >          
1199            }
1200 +          /* select stunt doubles for center-of-mass reference point.  */
1201 +          else if (strcmp (long_options[option_index].name, "comsele") == 0)
1202 +          {
1203 +          
1204 +          
1205 +            if (update_arg( (void *)&(args_info->comsele_arg),
1206 +                 &(args_info->comsele_orig), &(args_info->comsele_given),
1207 +                &(local_args_info.comsele_given), optarg, 0, 0, ARG_STRING,
1208 +                check_ambiguity, override, 0, 0,
1209 +                "comsele", '-',
1210 +                additional_error))
1211 +              goto failure;
1212 +          
1213 +          }
1214            /* molecule name.  */
1215            else if (strcmp (long_options[option_index].name, "molname") == 0)
1216            {
1217 <            if (local_args_info.molname_given)
1218 <              {
1219 <                fprintf (stderr, "%s: `--molname' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1220 <                goto failure;
1221 <              }
1222 <            if (args_info->molname_given && ! override)
1223 <              continue;
1224 <            local_args_info.molname_given = 1;
1225 <            args_info->molname_given = 1;
1226 <            if (args_info->molname_arg)
1109 <              free (args_info->molname_arg); /* free previous string */
1110 <            args_info->molname_arg = gengetopt_strdup (optarg);
1111 <            if (args_info->molname_orig)
1112 <              free (args_info->molname_orig); /* free previous string */
1113 <            args_info->molname_orig = gengetopt_strdup (optarg);
1217 >          
1218 >          
1219 >            if (update_arg( (void *)&(args_info->molname_arg),
1220 >                 &(args_info->molname_orig), &(args_info->molname_given),
1221 >                &(local_args_info.molname_given), optarg, 0, 0, ARG_STRING,
1222 >                check_ambiguity, override, 0, 0,
1223 >                "molname", '-',
1224 >                additional_error))
1225 >              goto failure;
1226 >          
1227            }
1228            /* begin internal index.  */
1229            else if (strcmp (long_options[option_index].name, "begin") == 0)
1230            {
1231 <            if (local_args_info.begin_given)
1232 <              {
1233 <                fprintf (stderr, "%s: `--begin' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1234 <                goto failure;
1235 <              }
1236 <            if (args_info->begin_given && ! override)
1237 <              continue;
1238 <            local_args_info.begin_given = 1;
1126 <            args_info->begin_given = 1;
1127 <            args_info->begin_arg = strtol (optarg, &stop_char, 0);
1128 <            if (!(stop_char && *stop_char == '\0')) {
1129 <              fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
1231 >          
1232 >          
1233 >            if (update_arg( (void *)&(args_info->begin_arg),
1234 >                 &(args_info->begin_orig), &(args_info->begin_given),
1235 >                &(local_args_info.begin_given), optarg, 0, 0, ARG_INT,
1236 >                check_ambiguity, override, 0, 0,
1237 >                "begin", '-',
1238 >                additional_error))
1239                goto failure;
1240 <            }
1132 <            if (args_info->begin_orig)
1133 <              free (args_info->begin_orig); /* free previous string */
1134 <            args_info->begin_orig = gengetopt_strdup (optarg);
1240 >          
1241            }
1242            /* end internal index.  */
1243            else if (strcmp (long_options[option_index].name, "end") == 0)
1244            {
1245 <            if (local_args_info.end_given)
1246 <              {
1247 <                fprintf (stderr, "%s: `--end' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1248 <                goto failure;
1249 <              }
1250 <            if (args_info->end_given && ! override)
1251 <              continue;
1252 <            local_args_info.end_given = 1;
1147 <            args_info->end_given = 1;
1148 <            args_info->end_arg = strtol (optarg, &stop_char, 0);
1149 <            if (!(stop_char && *stop_char == '\0')) {
1150 <              fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
1245 >          
1246 >          
1247 >            if (update_arg( (void *)&(args_info->end_arg),
1248 >                 &(args_info->end_orig), &(args_info->end_given),
1249 >                &(local_args_info.end_given), optarg, 0, 0, ARG_INT,
1250 >                check_ambiguity, override, 0, 0,
1251 >                "end", '-',
1252 >                additional_error))
1253                goto failure;
1254 <            }
1153 <            if (args_info->end_orig)
1154 <              free (args_info->end_orig); /* free previous string */
1155 <            args_info->end_orig = gengetopt_strdup (optarg);
1254 >          
1255            }
1256            /* nanoparticle radius.  */
1257            else if (strcmp (long_options[option_index].name, "radius") == 0)
1258            {
1259 <            if (local_args_info.radius_given)
1260 <              {
1261 <                fprintf (stderr, "%s: `--radius' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1262 <                goto failure;
1263 <              }
1264 <            if (args_info->radius_given && ! override)
1265 <              continue;
1266 <            local_args_info.radius_given = 1;
1168 <            args_info->radius_given = 1;
1169 <            args_info->radius_arg = strtod (optarg, &stop_char);
1170 <            if (!(stop_char && *stop_char == '\0')) {
1171 <              fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
1259 >          
1260 >          
1261 >            if (update_arg( (void *)&(args_info->radius_arg),
1262 >                 &(args_info->radius_orig), &(args_info->radius_given),
1263 >                &(local_args_info.radius_given), optarg, 0, 0, ARG_DOUBLE,
1264 >                check_ambiguity, override, 0, 0,
1265 >                "radius", '-',
1266 >                additional_error))
1267                goto failure;
1268 <            }
1174 <            if (args_info->radius_orig)
1175 <              free (args_info->radius_orig); /* free previous string */
1176 <            args_info->radius_orig = gengetopt_strdup (optarg);
1268 >          
1269            }
1270            /* bond order parameter (--rcut must be specified).  */
1271            else if (strcmp (long_options[option_index].name, "bo") == 0)
1272            {
1273 <            if (local_args_info.bo_given)
1182 <              {
1183 <                fprintf (stderr, "%s: `--bo' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1184 <                goto failure;
1185 <              }
1186 <            if (args_info->bo_given && ! override)
1187 <              continue;
1188 <            local_args_info.bo_given = 1;
1189 <            args_info->bo_given = 1;
1273 >          
1274              if (args_info->staticProps_group_counter && override)
1275                reset_group_staticProps (args_info);
1276              args_info->staticProps_group_counter += 1;
1277 <            break;
1277 >          
1278 >            if (update_arg( 0 ,
1279 >                 0 , &(args_info->bo_given),
1280 >                &(local_args_info.bo_given), optarg, 0, 0, ARG_NO,
1281 >                check_ambiguity, override, 0, 0,
1282 >                "bo", '-',
1283 >                additional_error))
1284 >              goto failure;
1285 >          
1286            }
1287            /* bond order parameter as a function of radius (--rcut must be specified).  */
1288            else if (strcmp (long_options[option_index].name, "bor") == 0)
1289            {
1290 <            if (local_args_info.bor_given)
1199 <              {
1200 <                fprintf (stderr, "%s: `--bor' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1201 <                goto failure;
1202 <              }
1203 <            if (args_info->bor_given && ! override)
1204 <              continue;
1205 <            local_args_info.bor_given = 1;
1206 <            args_info->bor_given = 1;
1290 >          
1291              if (args_info->staticProps_group_counter && override)
1292                reset_group_staticProps (args_info);
1293              args_info->staticProps_group_counter += 1;
1294 <            break;
1294 >          
1295 >            if (update_arg( 0 ,
1296 >                 0 , &(args_info->bor_given),
1297 >                &(local_args_info.bor_given), optarg, 0, 0, ARG_NO,
1298 >                check_ambiguity, override, 0, 0,
1299 >                "bor", '-',
1300 >                additional_error))
1301 >              goto failure;
1302 >          
1303            }
1304 +          /* N(theta) bond angle density within (--rcut must be specified).  */
1305 +          else if (strcmp (long_options[option_index].name, "bad") == 0)
1306 +          {
1307 +          
1308 +            if (args_info->staticProps_group_counter && override)
1309 +              reset_group_staticProps (args_info);
1310 +            args_info->staticProps_group_counter += 1;
1311 +          
1312 +            if (update_arg( 0 ,
1313 +                 0 , &(args_info->bad_given),
1314 +                &(local_args_info.bad_given), optarg, 0, 0, ARG_NO,
1315 +                check_ambiguity, override, 0, 0,
1316 +                "bad", '-',
1317 +                additional_error))
1318 +              goto failure;
1319 +          
1320 +          }
1321 +          /* count of molecules matching selection criteria (and associated statistics).  */
1322 +          else if (strcmp (long_options[option_index].name, "count") == 0)
1323 +          {
1324 +          
1325 +            if (args_info->staticProps_group_counter && override)
1326 +              reset_group_staticProps (args_info);
1327 +            args_info->staticProps_group_counter += 1;
1328 +          
1329 +            if (update_arg( 0 ,
1330 +                 0 , &(args_info->count_given),
1331 +                &(local_args_info.count_given), optarg, 0, 0, ARG_NO,
1332 +                check_ambiguity, override, 0, 0,
1333 +                "count", '-',
1334 +                additional_error))
1335 +              goto failure;
1336 +          
1337 +          }
1338 +          /* g(z).  */
1339 +          else if (strcmp (long_options[option_index].name, "gofz") == 0)
1340 +          {
1341 +          
1342 +            if (args_info->staticProps_group_counter && override)
1343 +              reset_group_staticProps (args_info);
1344 +            args_info->staticProps_group_counter += 1;
1345 +          
1346 +            if (update_arg( 0 ,
1347 +                 0 , &(args_info->gofz_given),
1348 +                &(local_args_info.gofz_given), optarg, 0, 0, ARG_NO,
1349 +                check_ambiguity, override, 0, 0,
1350 +                "gofz", '-',
1351 +                additional_error))
1352 +              goto failure;
1353 +          
1354 +          }
1355            /* g(r, cos(theta)).  */
1356            else if (strcmp (long_options[option_index].name, "r_theta") == 0)
1357            {
1358 <            if (local_args_info.r_theta_given)
1216 <              {
1217 <                fprintf (stderr, "%s: `--r_theta' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1218 <                goto failure;
1219 <              }
1220 <            if (args_info->r_theta_given && ! override)
1221 <              continue;
1222 <            local_args_info.r_theta_given = 1;
1223 <            args_info->r_theta_given = 1;
1358 >          
1359              if (args_info->staticProps_group_counter && override)
1360                reset_group_staticProps (args_info);
1361              args_info->staticProps_group_counter += 1;
1362 <            break;
1362 >          
1363 >            if (update_arg( 0 ,
1364 >                 0 , &(args_info->r_theta_given),
1365 >                &(local_args_info.r_theta_given), optarg, 0, 0, ARG_NO,
1366 >                check_ambiguity, override, 0, 0,
1367 >                "r_theta", '-',
1368 >                additional_error))
1369 >              goto failure;
1370 >          
1371            }
1372            /* g(r, cos(omega)).  */
1373            else if (strcmp (long_options[option_index].name, "r_omega") == 0)
1374            {
1375 <            if (local_args_info.r_omega_given)
1233 <              {
1234 <                fprintf (stderr, "%s: `--r_omega' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1235 <                goto failure;
1236 <              }
1237 <            if (args_info->r_omega_given && ! override)
1238 <              continue;
1239 <            local_args_info.r_omega_given = 1;
1240 <            args_info->r_omega_given = 1;
1375 >          
1376              if (args_info->staticProps_group_counter && override)
1377                reset_group_staticProps (args_info);
1378              args_info->staticProps_group_counter += 1;
1379 <            break;
1379 >          
1380 >            if (update_arg( 0 ,
1381 >                 0 , &(args_info->r_omega_given),
1382 >                &(local_args_info.r_omega_given), optarg, 0, 0, ARG_NO,
1383 >                check_ambiguity, override, 0, 0,
1384 >                "r_omega", '-',
1385 >                additional_error))
1386 >              goto failure;
1387 >          
1388            }
1389 +          /* g(r, z).  */
1390 +          else if (strcmp (long_options[option_index].name, "r_z") == 0)
1391 +          {
1392 +          
1393 +            if (args_info->staticProps_group_counter && override)
1394 +              reset_group_staticProps (args_info);
1395 +            args_info->staticProps_group_counter += 1;
1396 +          
1397 +            if (update_arg( 0 ,
1398 +                 0 , &(args_info->r_z_given),
1399 +                &(local_args_info.r_z_given), optarg, 0, 0, ARG_NO,
1400 +                check_ambiguity, override, 0, 0,
1401 +                "r_z", '-',
1402 +                additional_error))
1403 +              goto failure;
1404 +          
1405 +          }
1406            /* g(cos(theta), cos(omega)).  */
1407            else if (strcmp (long_options[option_index].name, "theta_omega") == 0)
1408            {
1409 <            if (local_args_info.theta_omega_given)
1250 <              {
1251 <                fprintf (stderr, "%s: `--theta_omega' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1252 <                goto failure;
1253 <              }
1254 <            if (args_info->theta_omega_given && ! override)
1255 <              continue;
1256 <            local_args_info.theta_omega_given = 1;
1257 <            args_info->theta_omega_given = 1;
1409 >          
1410              if (args_info->staticProps_group_counter && override)
1411                reset_group_staticProps (args_info);
1412              args_info->staticProps_group_counter += 1;
1413 <            break;
1413 >          
1414 >            if (update_arg( 0 ,
1415 >                 0 , &(args_info->theta_omega_given),
1416 >                &(local_args_info.theta_omega_given), optarg, 0, 0, ARG_NO,
1417 >                check_ambiguity, override, 0, 0,
1418 >                "theta_omega", '-',
1419 >                additional_error))
1420 >              goto failure;
1421 >          
1422            }
1423            /* g(x, y, z).  */
1424            else if (strcmp (long_options[option_index].name, "gxyz") == 0)
1425            {
1426 <            if (local_args_info.gxyz_given)
1267 <              {
1268 <                fprintf (stderr, "%s: `--gxyz' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1269 <                goto failure;
1270 <              }
1271 <            if (args_info->gxyz_given && ! override)
1272 <              continue;
1273 <            local_args_info.gxyz_given = 1;
1274 <            args_info->gxyz_given = 1;
1426 >          
1427              if (args_info->staticProps_group_counter && override)
1428                reset_group_staticProps (args_info);
1429              args_info->staticProps_group_counter += 1;
1430 <            break;
1430 >          
1431 >            if (update_arg( 0 ,
1432 >                 0 , &(args_info->gxyz_given),
1433 >                &(local_args_info.gxyz_given), optarg, 0, 0, ARG_NO,
1434 >                check_ambiguity, override, 0, 0,
1435 >                "gxyz", '-',
1436 >                additional_error))
1437 >              goto failure;
1438 >          
1439            }
1440 +          /* 2D g(r) (Slab width --dz must be specified).  */
1441 +          else if (strcmp (long_options[option_index].name, "twodgofr") == 0)
1442 +          {
1443 +          
1444 +            if (args_info->staticProps_group_counter && override)
1445 +              reset_group_staticProps (args_info);
1446 +            args_info->staticProps_group_counter += 1;
1447 +          
1448 +            if (update_arg( 0 ,
1449 +                 0 , &(args_info->twodgofr_given),
1450 +                &(local_args_info.twodgofr_given), optarg, 0, 0, ARG_NO,
1451 +                check_ambiguity, override, 0, 0,
1452 +                "twodgofr", '-',
1453 +                additional_error))
1454 +              goto failure;
1455 +          
1456 +          }
1457            /* rp2 order parameter (--sele1 and --sele2 must be specified).  */
1458            else if (strcmp (long_options[option_index].name, "rp2") == 0)
1459            {
1460 <            if (local_args_info.rp2_given)
1284 <              {
1285 <                fprintf (stderr, "%s: `--rp2' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1286 <                goto failure;
1287 <              }
1288 <            if (args_info->rp2_given && ! override)
1289 <              continue;
1290 <            local_args_info.rp2_given = 1;
1291 <            args_info->rp2_given = 1;
1460 >          
1461              if (args_info->staticProps_group_counter && override)
1462                reset_group_staticProps (args_info);
1463              args_info->staticProps_group_counter += 1;
1464 <            break;
1464 >          
1465 >            if (update_arg( 0 ,
1466 >                 0 , &(args_info->rp2_given),
1467 >                &(local_args_info.rp2_given), optarg, 0, 0, ARG_NO,
1468 >                check_ambiguity, override, 0, 0,
1469 >                "rp2", '-',
1470 >                additional_error))
1471 >              goto failure;
1472 >          
1473            }
1474            /* slab density.  */
1475            else if (strcmp (long_options[option_index].name, "slab_density") == 0)
1476            {
1477 <            if (local_args_info.slab_density_given)
1301 <              {
1302 <                fprintf (stderr, "%s: `--slab_density' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1303 <                goto failure;
1304 <              }
1305 <            if (args_info->slab_density_given && ! override)
1306 <              continue;
1307 <            local_args_info.slab_density_given = 1;
1308 <            args_info->slab_density_given = 1;
1477 >          
1478              if (args_info->staticProps_group_counter && override)
1479                reset_group_staticProps (args_info);
1480              args_info->staticProps_group_counter += 1;
1481 <            break;
1481 >          
1482 >            if (update_arg( 0 ,
1483 >                 0 , &(args_info->slab_density_given),
1484 >                &(local_args_info.slab_density_given), optarg, 0, 0, ARG_NO,
1485 >                check_ambiguity, override, 0, 0,
1486 >                "slab_density", '-',
1487 >                additional_error))
1488 >              goto failure;
1489 >          
1490            }
1491 +          /* p(cos(theta)).  */
1492 +          else if (strcmp (long_options[option_index].name, "p_angle") == 0)
1493 +          {
1494 +          
1495 +            if (args_info->staticProps_group_counter && override)
1496 +              reset_group_staticProps (args_info);
1497 +            args_info->staticProps_group_counter += 1;
1498 +          
1499 +            if (update_arg( 0 ,
1500 +                 0 , &(args_info->p_angle_given),
1501 +                &(local_args_info.p_angle_given), optarg, 0, 0, ARG_NO,
1502 +                check_ambiguity, override, 0, 0,
1503 +                "p_angle", '-',
1504 +                additional_error))
1505 +              goto failure;
1506 +          
1507 +          }
1508            /* hxy.  */
1509            else if (strcmp (long_options[option_index].name, "hxy") == 0)
1510            {
1511 <            if (local_args_info.hxy_given)
1318 <              {
1319 <                fprintf (stderr, "%s: `--hxy' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1320 <                goto failure;
1321 <              }
1322 <            if (args_info->hxy_given && ! override)
1323 <              continue;
1324 <            local_args_info.hxy_given = 1;
1325 <            args_info->hxy_given = 1;
1511 >          
1512              if (args_info->staticProps_group_counter && override)
1513                reset_group_staticProps (args_info);
1514              args_info->staticProps_group_counter += 1;
1515 <            break;
1515 >          
1516 >            if (update_arg( 0 ,
1517 >                 0 , &(args_info->hxy_given),
1518 >                &(local_args_info.hxy_given), optarg, 0, 0, ARG_NO,
1519 >                check_ambiguity, override, 0, 0,
1520 >                "hxy", '-',
1521 >                additional_error))
1522 >              goto failure;
1523 >          
1524            }
1525            /* rho of R.  */
1526            else if (strcmp (long_options[option_index].name, "rho_r") == 0)
1527            {
1528 <            if (local_args_info.rho_r_given)
1335 <              {
1336 <                fprintf (stderr, "%s: `--rho_r' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1337 <                goto failure;
1338 <              }
1339 <            if (args_info->rho_r_given && ! override)
1340 <              continue;
1341 <            local_args_info.rho_r_given = 1;
1342 <            args_info->rho_r_given = 1;
1528 >          
1529              if (args_info->staticProps_group_counter && override)
1530                reset_group_staticProps (args_info);
1531              args_info->staticProps_group_counter += 1;
1532 <            break;
1532 >          
1533 >            if (update_arg( 0 ,
1534 >                 0 , &(args_info->rho_r_given),
1535 >                &(local_args_info.rho_r_given), optarg, 0, 0, ARG_NO,
1536 >                check_ambiguity, override, 0, 0,
1537 >                "rho_r", '-',
1538 >                additional_error))
1539 >              goto failure;
1540 >          
1541            }
1542 +          /* angle of R.  */
1543 +          else if (strcmp (long_options[option_index].name, "angle_r") == 0)
1544 +          {
1545            
1546 +            if (args_info->staticProps_group_counter && override)
1547 +              reset_group_staticProps (args_info);
1548 +            args_info->staticProps_group_counter += 1;
1549 +          
1550 +            if (update_arg( 0 ,
1551 +                 0 , &(args_info->angle_r_given),
1552 +                &(local_args_info.angle_r_given), optarg, 0, 0, ARG_NO,
1553 +                check_ambiguity, override, 0, 0,
1554 +                "angle_r", '-',
1555 +                additional_error))
1556 +              goto failure;
1557 +          
1558 +          }
1559 +          /* hull volume of nanoparticle.  */
1560 +          else if (strcmp (long_options[option_index].name, "hullvol") == 0)
1561 +          {
1562 +          
1563 +            if (args_info->staticProps_group_counter && override)
1564 +              reset_group_staticProps (args_info);
1565 +            args_info->staticProps_group_counter += 1;
1566 +          
1567 +            if (update_arg( 0 ,
1568 +                 0 , &(args_info->hullvol_given),
1569 +                &(local_args_info.hullvol_given), optarg, 0, 0, ARG_NO,
1570 +                check_ambiguity, override, 0, 0,
1571 +                "hullvol", '-',
1572 +                additional_error))
1573 +              goto failure;
1574 +          
1575 +          }
1576 +          /* length of nanorod.  */
1577 +          else if (strcmp (long_options[option_index].name, "rodlength") == 0)
1578 +          {
1579 +          
1580 +            if (args_info->staticProps_group_counter && override)
1581 +              reset_group_staticProps (args_info);
1582 +            args_info->staticProps_group_counter += 1;
1583 +          
1584 +            if (update_arg( 0 ,
1585 +                 0 , &(args_info->rodlength_given),
1586 +                &(local_args_info.rodlength_given), optarg, 0, 0, ARG_NO,
1587 +                check_ambiguity, override, 0, 0,
1588 +                "rodlength", '-',
1589 +                additional_error))
1590 +              goto failure;
1591 +          
1592 +          }
1593 +          /* tetrahedrality order parameter by zbin(--sele1 must be specified).  */
1594 +          else if (strcmp (long_options[option_index].name, "tet_param_z") == 0)
1595 +          {
1596 +          
1597 +            if (args_info->staticProps_group_counter && override)
1598 +              reset_group_staticProps (args_info);
1599 +            args_info->staticProps_group_counter += 1;
1600 +          
1601 +            if (update_arg( 0 ,
1602 +                 0 , &(args_info->tet_param_z_given),
1603 +                &(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO,
1604 +                check_ambiguity, override, 0, 0,
1605 +                "tet_param_z", '-',
1606 +                additional_error))
1607 +              goto failure;
1608 +          
1609 +          }
1610 +          
1611            break;
1612          case '?':       /* Invalid option.  */
1613            /* `getopt_long' already printed an error message.  */
# Line 1359 | Line 1621 | cmdline_parser_internal (int argc, char * const *argv,
1621  
1622    if (args_info->staticProps_group_counter > 1)
1623      {
1624 <      fprintf (stderr, "%s: %d options of group staticProps were given. One is required.%s\n", argv[0], args_info->staticProps_group_counter, (additional_error ? additional_error : ""));
1624 >      fprintf (stderr, "%s: %d options of group staticProps were given. One is required%s.\n", argv[0], args_info->staticProps_group_counter, (additional_error ? additional_error : ""));
1625        error = 1;
1626      }
1627    

Comparing:
trunk/src/applications/staticProps/StaticPropsCmd.c (property svn:keywords), Revision 1128 by chuckv, Wed Apr 11 23:27:20 2007 UTC vs.
trunk/src/applications/staticProps/StaticPropsCmd.cpp (property svn:keywords), Revision 1795 by gezelter, Fri Sep 7 18:13:55 2012 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines