1 |
|
/* |
2 |
|
File autogenerated by gengetopt version 2.11 |
3 |
|
generated with the following command: |
4 |
< |
/home/maul/gezelter/tim/bin/gengetopt -F staticPropsCmd |
4 |
> |
/home/maul/gezelter/tim/bin/gengetopt -F StaticPropsCmd |
5 |
|
|
6 |
|
The developers of gengetopt consider the fixed text that goes in all |
7 |
|
gengetopt output files to be in the public domain: |
20 |
|
|
21 |
|
#include "getopt.h" |
22 |
|
|
23 |
< |
#include "staticPropsCmd.h" |
23 |
> |
#include "StaticPropsCmd.h" |
24 |
|
|
25 |
|
void |
26 |
|
cmdline_parser_print_version (void) |
39 |
|
printf(" -V, --version Print version and exit\n"); |
40 |
|
printf(" -i, --input=filename input dump file\n"); |
41 |
|
printf(" -o, --output=filename output file name\n"); |
42 |
< |
printf(" -n, --frame=INT print every n frame (default=`1')\n"); |
43 |
< |
printf(" -d, --ndistebins=INT number of bins for distance (default=`50')\n"); |
42 |
> |
printf(" -n, --step=INT process every n frame (default=`1')\n"); |
43 |
> |
printf(" -r, --nrbins=INT number of bins for distance (default=`50')\n"); |
44 |
|
printf(" -a, --nanglebins=INT number of bins for cos(angle) (default=`50')\n"); |
45 |
< |
printf(" -l, --length=DOUBLE maximum length\n"); |
45 |
> |
printf(" -l, --length=DOUBLE maximum length (Defaults to 1/2 smallest \n length of first frame)\n"); |
46 |
|
printf(" --sele1=selection script select first stuntdouble set\n"); |
47 |
|
printf(" --sele2=selection script select second stuntdouble set\n"); |
48 |
|
printf("\n"); |
81 |
|
args_info->version_given = 0 ; |
82 |
|
args_info->input_given = 0 ; |
83 |
|
args_info->output_given = 0 ; |
84 |
< |
args_info->frame_given = 0 ; |
85 |
< |
args_info->ndistebins_given = 0 ; |
84 |
> |
args_info->step_given = 0 ; |
85 |
> |
args_info->nrbins_given = 0 ; |
86 |
|
args_info->nanglebins_given = 0 ; |
87 |
|
args_info->length_given = 0 ; |
88 |
|
args_info->sele1_given = 0 ; |
95 |
|
#define clear_args() { \ |
96 |
|
args_info->input_arg = NULL; \ |
97 |
|
args_info->output_arg = NULL; \ |
98 |
< |
args_info->frame_arg = 1 ;\ |
99 |
< |
args_info->ndistebins_arg = 50 ;\ |
98 |
> |
args_info->step_arg = 1 ;\ |
99 |
> |
args_info->nrbins_arg = 50 ;\ |
100 |
|
args_info->nanglebins_arg = 50 ;\ |
101 |
|
args_info->sele1_arg = NULL; \ |
102 |
|
args_info->sele2_arg = NULL; \ |
119 |
|
{ "version", 0, NULL, 'V' }, |
120 |
|
{ "input", 1, NULL, 'i' }, |
121 |
|
{ "output", 1, NULL, 'o' }, |
122 |
< |
{ "frame", 1, NULL, 'n' }, |
123 |
< |
{ "ndistebins", 1, NULL, 'd' }, |
122 |
> |
{ "step", 1, NULL, 'n' }, |
123 |
> |
{ "nrbins", 1, NULL, 'r' }, |
124 |
|
{ "nanglebins", 1, NULL, 'a' }, |
125 |
|
{ "length", 1, NULL, 'l' }, |
126 |
|
{ "sele1", 1, NULL, 0 }, |
134 |
|
}; |
135 |
|
|
136 |
|
stop_char = 0; |
137 |
< |
c = getopt_long (argc, argv, "hVi:o:n:d:a:l:", long_options, &option_index); |
137 |
> |
c = getopt_long (argc, argv, "hVi:o:n:r:a:l:", long_options, &option_index); |
138 |
|
|
139 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
140 |
|
|
172 |
|
args_info->output_arg = gengetopt_strdup (optarg); |
173 |
|
break; |
174 |
|
|
175 |
< |
case 'n': /* print every n frame. */ |
176 |
< |
if (args_info->frame_given) |
175 |
> |
case 'n': /* process every n frame. */ |
176 |
> |
if (args_info->step_given) |
177 |
|
{ |
178 |
< |
fprintf (stderr, "%s: `--frame' (`-n') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
178 |
> |
fprintf (stderr, "%s: `--step' (`-n') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
179 |
|
clear_args (); |
180 |
|
exit (EXIT_FAILURE); |
181 |
|
} |
182 |
< |
args_info->frame_given = 1; |
183 |
< |
args_info->frame_arg = strtol (optarg,&stop_char,0); |
182 |
> |
args_info->step_given = 1; |
183 |
> |
args_info->step_arg = strtol (optarg,&stop_char,0); |
184 |
|
break; |
185 |
|
|
186 |
< |
case 'd': /* number of bins for distance. */ |
187 |
< |
if (args_info->ndistebins_given) |
186 |
> |
case 'r': /* number of bins for distance. */ |
187 |
> |
if (args_info->nrbins_given) |
188 |
|
{ |
189 |
< |
fprintf (stderr, "%s: `--ndistebins' (`-d') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
189 |
> |
fprintf (stderr, "%s: `--nrbins' (`-r') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
190 |
|
clear_args (); |
191 |
|
exit (EXIT_FAILURE); |
192 |
|
} |
193 |
< |
args_info->ndistebins_given = 1; |
194 |
< |
args_info->ndistebins_arg = strtol (optarg,&stop_char,0); |
193 |
> |
args_info->nrbins_given = 1; |
194 |
> |
args_info->nrbins_arg = strtol (optarg,&stop_char,0); |
195 |
|
break; |
196 |
|
|
197 |
|
case 'a': /* number of bins for cos(angle). */ |
205 |
|
args_info->nanglebins_arg = strtol (optarg,&stop_char,0); |
206 |
|
break; |
207 |
|
|
208 |
< |
case 'l': /* maximum length. */ |
208 |
> |
case 'l': /* maximum length (Defaults to 1/2 smallest length of first frame). */ |
209 |
|
if (args_info->length_given) |
210 |
|
{ |
211 |
|
fprintf (stderr, "%s: `--length' (`-l') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
339 |
|
fprintf (stderr, "%s: '--input' ('-i') option required\n", CMDLINE_PARSER_PACKAGE); |
340 |
|
missing_required_options = 1; |
341 |
|
} |
342 |
– |
if (! args_info->length_given) |
343 |
– |
{ |
344 |
– |
fprintf (stderr, "%s: '--length' ('-l') option required\n", CMDLINE_PARSER_PACKAGE); |
345 |
– |
missing_required_options = 1; |
346 |
– |
} |
342 |
|
if ( missing_required_options ) |
343 |
|
exit (EXIT_FAILURE); |
344 |
|
|