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

Comparing:
trunk/src/applications/staticProps/StaticPropsCmd.c (file contents), Revision 1128 by chuckv, Wed Apr 11 23:27:20 2007 UTC vs.
trunk/src/applications/staticProps/StaticPropsCmd.cpp (file contents), Revision 1819 by gezelter, Thu Dec 13 16:57:39 2012 UTC

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

Comparing:
trunk/src/applications/staticProps/StaticPropsCmd.c (property svn:keywords), Revision 1128 by chuckv, Wed Apr 11 23:27:20 2007 UTC vs.
trunk/src/applications/staticProps/StaticPropsCmd.cpp (property svn:keywords), Revision 1819 by gezelter, Thu Dec 13 16:57:39 2012 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines