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

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

Comparing trunk/src/applications/staticProps/StaticPropsCmd.c (property svn:keywords):
Revision 1213 by xsun, Wed Jan 23 21:21:50 2008 UTC vs.
Revision 1531 by kstocke1, Wed Dec 29 16:48:19 2010 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines