1 |
|
/* |
2 |
|
File autogenerated by gengetopt version 2.12.1 |
3 |
|
generated with the following command: |
4 |
< |
gengetopt --file-name=shaperCmd |
4 |
> |
gengetopt --file-name=shaperCmd --unamed-opts=PDBFILE |
5 |
|
|
6 |
|
The developers of gengetopt consider the fixed text that goes in all |
7 |
|
gengetopt output files to be in the public domain: |
37 |
|
{ |
38 |
|
args_info->help_given = 0 ; |
39 |
|
args_info->version_given = 0 ; |
40 |
– |
args_info->input_given = 0 ; |
40 |
|
args_info->bandwidth_given = 0 ; |
41 |
+ |
args_info->tolerance_given = 0 ; |
42 |
|
args_info->charmm_given = 0 ; |
43 |
|
args_info->amber_given = 0 ; |
44 |
|
args_info->lj_given = 0 ; |
50 |
|
static |
51 |
|
void clear_args (struct gengetopt_args_info *args_info) |
52 |
|
{ |
53 |
– |
args_info->input_arg = NULL; |
53 |
|
args_info->bandwidth_arg = 8 ; |
54 |
+ |
args_info->tolerance_arg = 0.01 ; |
55 |
|
} |
56 |
|
|
57 |
|
void |
65 |
|
{ |
66 |
|
cmdline_parser_print_version (); |
67 |
|
printf("\n" |
68 |
< |
"Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE); |
68 |
> |
"Usage: %s [OPTIONS]... [PDBFILE]...\n", CMDLINE_PARSER_PACKAGE); |
69 |
|
printf("\n"); |
70 |
< |
printf("%s\n"," -h, --help Print help and exit"); |
71 |
< |
printf("%s\n"," -V, --version Print version and exit"); |
72 |
< |
printf("%s\n"," -i, --input=filename input file name"); |
73 |
< |
printf("%s\n"," -b, --bandwidth=INT The step detail for the potential grids - typically a \n power of 2 (default=`8')"); |
70 |
> |
printf("%s\n"," -h, --help Print help and exit"); |
71 |
> |
printf("%s\n"," -V, --version Print version and exit"); |
72 |
> |
printf("%s\n"," -b, --bandwidth=INT The step detail for the potential grids - typically \n a power of 2 (default=`8')"); |
73 |
> |
printf("%s\n"," -t, --tolerance=DOUBLE The tolerance for recognition of spherical harmonic \n terms (default=`0.01')"); |
74 |
|
printf("\n"); |
75 |
|
printf(" Group: ForceField A Force Field must be specified\n"); |
76 |
< |
printf("%s\n"," -c, --charmm Use CHARMM 27 parameters"); |
77 |
< |
printf("%s\n"," -a, --amber Use Amber99 parameters"); |
78 |
< |
printf("%s\n"," -l, --lj Use Lennard-Jones parameters"); |
79 |
< |
printf("%s\n"," -g, --gaff Use GAFF parameters"); |
80 |
< |
printf("%s\n"," -o, --opls Use OPLS/AA parameters"); |
76 |
> |
printf("%s\n"," -c, --charmm Use CHARMM 27 parameters"); |
77 |
> |
printf("%s\n"," -a, --amber Use Amber99 parameters"); |
78 |
> |
printf("%s\n"," -l, --lj Use Lennard-Jones parameters"); |
79 |
> |
printf("%s\n"," -g, --gaff Use GAFF parameters"); |
80 |
> |
printf("%s\n"," -o, --opls Use OPLS/AA parameters"); |
81 |
|
} |
82 |
|
|
83 |
|
void |
85 |
|
{ |
86 |
|
clear_given (args_info); |
87 |
|
clear_args (args_info); |
88 |
+ |
|
89 |
+ |
args_info->inputs = NULL; |
90 |
+ |
args_info->inputs_num = 0; |
91 |
|
} |
92 |
|
|
93 |
|
void |
94 |
|
cmdline_parser_free (struct gengetopt_args_info *args_info) |
95 |
|
{ |
96 |
|
|
97 |
< |
if (args_info->input_arg) |
95 |
< |
{ |
96 |
< |
free (args_info->input_arg); /* free previous argument */ |
97 |
< |
args_info->input_arg = 0; |
98 |
< |
} |
97 |
> |
int i; |
98 |
|
|
99 |
+ |
for (i = 0; i < args_info->inputs_num; ++i) |
100 |
+ |
free (args_info->inputs [i]); |
101 |
+ |
|
102 |
+ |
if (args_info->inputs_num) |
103 |
+ |
free (args_info->inputs); |
104 |
+ |
|
105 |
|
clear_given (args_info); |
106 |
|
} |
107 |
|
|
187 |
|
static struct option long_options[] = { |
188 |
|
{ "help", 0, NULL, 'h' }, |
189 |
|
{ "version", 0, NULL, 'V' }, |
185 |
– |
{ "input", 1, NULL, 'i' }, |
190 |
|
{ "bandwidth", 1, NULL, 'b' }, |
191 |
+ |
{ "tolerance", 1, NULL, 't' }, |
192 |
|
{ "charmm", 0, NULL, 'c' }, |
193 |
|
{ "amber", 0, NULL, 'a' }, |
194 |
|
{ "lj", 0, NULL, 'l' }, |
198 |
|
}; |
199 |
|
|
200 |
|
stop_char = 0; |
201 |
< |
c = getopt_long (argc, argv, "hVi:b:calgo", long_options, &option_index); |
201 |
> |
c = getopt_long (argc, argv, "hVb:t:calgo", long_options, &option_index); |
202 |
|
|
203 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
204 |
|
|
212 |
|
cmdline_parser_print_version (); |
213 |
|
exit (EXIT_SUCCESS); |
214 |
|
|
210 |
– |
case 'i': /* input file name. */ |
211 |
– |
if (local_args_info.input_given) |
212 |
– |
{ |
213 |
– |
fprintf (stderr, "%s: `--input' (`-i') option given more than once%s\n", CMDLINE_PARSER_PACKAGE, (additional_error ? additional_error : "")); |
214 |
– |
goto failure; |
215 |
– |
} |
216 |
– |
if (args_info->input_given && ! override) |
217 |
– |
continue; |
218 |
– |
local_args_info.input_given = 1; |
219 |
– |
args_info->input_given = 1; |
220 |
– |
if (args_info->input_arg) |
221 |
– |
free (args_info->input_arg); /* free previous string */ |
222 |
– |
args_info->input_arg = gengetopt_strdup (optarg); |
223 |
– |
break; |
224 |
– |
|
215 |
|
case 'b': /* The step detail for the potential grids - typically a power of 2. */ |
216 |
|
if (local_args_info.bandwidth_given) |
217 |
|
{ |
225 |
|
args_info->bandwidth_arg = strtol (optarg,&stop_char,0); |
226 |
|
break; |
227 |
|
|
228 |
+ |
case 't': /* The tolerance for recognition of spherical harmonic terms. */ |
229 |
+ |
if (local_args_info.tolerance_given) |
230 |
+ |
{ |
231 |
+ |
fprintf (stderr, "%s: `--tolerance' (`-t') option given more than once%s\n", CMDLINE_PARSER_PACKAGE, (additional_error ? additional_error : "")); |
232 |
+ |
goto failure; |
233 |
+ |
} |
234 |
+ |
if (args_info->tolerance_given && ! override) |
235 |
+ |
continue; |
236 |
+ |
local_args_info.tolerance_given = 1; |
237 |
+ |
args_info->tolerance_given = 1; |
238 |
+ |
args_info->tolerance_arg = strtod (optarg, NULL); |
239 |
+ |
break; |
240 |
+ |
|
241 |
|
case 'c': /* Use CHARMM 27 parameters. */ |
242 |
|
if (local_args_info.charmm_given) |
243 |
|
{ |
336 |
|
|
337 |
|
if (check_required) |
338 |
|
{ |
336 |
– |
if (! args_info->input_given) |
337 |
– |
{ |
338 |
– |
fprintf (stderr, "%s: '--input' ('-i') option required%s\n", CMDLINE_PARSER_PACKAGE, (additional_error ? additional_error : "")); |
339 |
– |
error = 1; |
340 |
– |
} |
339 |
|
} |
340 |
|
|
341 |
|
if ( error ) |
342 |
|
return (EXIT_FAILURE); |
343 |
|
|
344 |
+ |
if (optind < argc) |
345 |
+ |
{ |
346 |
+ |
int i = 0 ; |
347 |
+ |
|
348 |
+ |
args_info->inputs_num = argc - optind ; |
349 |
+ |
args_info->inputs = |
350 |
+ |
(char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ; |
351 |
+ |
while (optind < argc) |
352 |
+ |
args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind++]) ; |
353 |
+ |
} |
354 |
+ |
|
355 |
|
return 0; |
356 |
|
|
357 |
|
failure: |