40 |
|
args_info->shape_given = 0 ; |
41 |
|
args_info->output_given = 0 ; |
42 |
|
args_info->grid_given = 0 ; |
43 |
+ |
args_info->range_given = 0 ; |
44 |
|
} |
45 |
|
|
46 |
|
static |
48 |
|
{ |
49 |
|
args_info->shape_arg = NULL; |
50 |
|
args_info->output_arg = NULL; |
51 |
< |
args_info->grid_arg = 51 ; |
51 |
> |
args_info->grid_arg = 101 ; |
52 |
> |
args_info->range_arg = 10 ; |
53 |
|
} |
54 |
|
|
55 |
|
void |
69 |
|
printf("%s\n"," -V, --version Print version and exit"); |
70 |
|
printf("%s\n"," -s, --shape=filename shape file name"); |
71 |
|
printf("%s\n"," -o, --output=filename output file name"); |
72 |
< |
printf("%s\n"," -g, --grid=INT number of grid points in each coordinate (default=\n `51')"); |
72 |
> |
printf("%s\n"," -g, --grid=INT number of grid points in each coordinate (default=\n `101')"); |
73 |
> |
printf("%s\n"," -r, --range=DOUBLE the sample range for the points in Angstroms (Ex: 10 =\n -10 to 10) (default=`10')"); |
74 |
|
} |
75 |
|
|
76 |
|
void |
165 |
|
{ "shape", 1, NULL, 's' }, |
166 |
|
{ "output", 1, NULL, 'o' }, |
167 |
|
{ "grid", 1, NULL, 'g' }, |
168 |
+ |
{ "range", 1, NULL, 'r' }, |
169 |
|
{ NULL, 0, NULL, 0 } |
170 |
|
}; |
171 |
|
|
172 |
|
stop_char = 0; |
173 |
< |
c = getopt_long (argc, argv, "hVs:o:g:", long_options, &option_index); |
173 |
> |
c = getopt_long (argc, argv, "hVs:o:g:r:", long_options, &option_index); |
174 |
|
|
175 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
176 |
|
|
227 |
|
args_info->grid_arg = strtol (optarg,&stop_char,0); |
228 |
|
break; |
229 |
|
|
230 |
+ |
case 'r': /* the sample range for the points in Angstroms (Ex: 10 = -10 to 10). */ |
231 |
+ |
if (local_args_info.range_given) |
232 |
+ |
{ |
233 |
+ |
fprintf (stderr, "%s: `--range' (`-r') option given more than once%s\n", CMDLINE_PARSER_PACKAGE, (additional_error ? additional_error : "")); |
234 |
+ |
goto failure; |
235 |
+ |
} |
236 |
+ |
if (args_info->range_given && ! override) |
237 |
+ |
continue; |
238 |
+ |
local_args_info.range_given = 1; |
239 |
+ |
args_info->range_given = 1; |
240 |
+ |
args_info->range_arg = strtod (optarg, NULL); |
241 |
+ |
break; |
242 |
|
|
243 |
+ |
|
244 |
|
case 0: /* Long option with no short option */ |
245 |
|
|
246 |
|
case '?': /* Invalid option. */ |