| 39 |
|
printf(" -V, --version Print version and exit\n"); |
| 40 |
|
printf(" -o, --output=STRING Output file name\n"); |
| 41 |
|
printf(" --latticetype=STRING Lattice type string. Valid types are fcc,hcp,bcc \n and hcp-water. (default=`fcc')\n"); |
| 42 |
< |
printf(" --density=DOUBLE density g/cm^3\n"); |
| 43 |
< |
printf(" --ndensity=DOUBLE number density\n"); |
| 42 |
> |
printf(" --density=DOUBLE density (g/cm^3)\n"); |
| 43 |
|
printf(" --nx=INT number of unit cells in x\n"); |
| 44 |
|
printf(" --ny=INT number of unit cells in y\n"); |
| 45 |
|
printf(" --nz=INT number of unit cells in z\n"); |
| 71 |
|
args_info->output_given = 0 ; |
| 72 |
|
args_info->latticetype_given = 0 ; |
| 73 |
|
args_info->density_given = 0 ; |
| 75 |
– |
args_info->ndensity_given = 0 ; |
| 74 |
|
args_info->nx_given = 0 ; |
| 75 |
|
args_info->ny_given = 0 ; |
| 76 |
|
args_info->nz_given = 0 ; |
| 100 |
|
{ "output", 1, NULL, 'o' }, |
| 101 |
|
{ "latticetype", 1, NULL, 0 }, |
| 102 |
|
{ "density", 1, NULL, 0 }, |
| 105 |
– |
{ "ndensity", 1, NULL, 0 }, |
| 103 |
|
{ "nx", 1, NULL, 0 }, |
| 104 |
|
{ "ny", 1, NULL, 0 }, |
| 105 |
|
{ "nz", 1, NULL, 0 }, |
| 152 |
|
break; |
| 153 |
|
} |
| 154 |
|
|
| 155 |
< |
/* density g/cm^3. */ |
| 155 |
> |
/* density (g/cm^3). */ |
| 156 |
|
else if (strcmp (long_options[option_index].name, "density") == 0) |
| 157 |
|
{ |
| 158 |
|
if (args_info->density_given) |
| 163 |
|
} |
| 164 |
|
args_info->density_given = 1; |
| 165 |
|
args_info->density_arg = strtod (optarg, NULL); |
| 169 |
– |
break; |
| 170 |
– |
} |
| 171 |
– |
|
| 172 |
– |
/* number density. */ |
| 173 |
– |
else if (strcmp (long_options[option_index].name, "ndensity") == 0) |
| 174 |
– |
{ |
| 175 |
– |
if (args_info->ndensity_given) |
| 176 |
– |
{ |
| 177 |
– |
fprintf (stderr, "%s: `--ndensity' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 178 |
– |
clear_args (); |
| 179 |
– |
exit (EXIT_FAILURE); |
| 180 |
– |
} |
| 181 |
– |
args_info->ndensity_given = 1; |
| 182 |
– |
args_info->ndensity_arg = strtod (optarg, NULL); |
| 166 |
|
break; |
| 167 |
|
} |
| 168 |
|
|
| 220 |
|
} /* while */ |
| 221 |
|
|
| 222 |
|
|
| 223 |
+ |
if (! args_info->density_given) |
| 224 |
+ |
{ |
| 225 |
+ |
fprintf (stderr, "%s: '--density' option required\n", CMDLINE_PARSER_PACKAGE); |
| 226 |
+ |
missing_required_options = 1; |
| 227 |
+ |
} |
| 228 |
|
if (! args_info->nx_given) |
| 229 |
|
{ |
| 230 |
|
fprintf (stderr, "%s: '--nx' option required\n", CMDLINE_PARSER_PACKAGE); |