1 |
|
/* |
2 |
|
File autogenerated by gengetopt version 2.22.4 |
3 |
|
generated with the following command: |
4 |
< |
/usr/local/bin/gengetopt -F DynamicPropsCmd -i DynamicProps.ggo |
4 |
> |
gengetopt -F DynamicPropsCmd -u |
5 |
|
|
6 |
|
The developers of gengetopt consider the fixed text that goes in all |
7 |
|
gengetopt output files to be in the public domain: |
27 |
|
|
28 |
|
const char *gengetopt_args_info_purpose = ""; |
29 |
|
|
30 |
< |
const char *gengetopt_args_info_usage = "Usage: DynamicProps [OPTIONS]..."; |
30 |
> |
const char *gengetopt_args_info_usage = "Usage: DynamicProps [OPTIONS]... [FILES]..."; |
31 |
|
|
32 |
|
const char *gengetopt_args_info_description = ""; |
33 |
|
|
50 |
|
" --thetacorr Angular rmsd", |
51 |
|
" --drcorr Directional rmsd for particles with unit \n vectors", |
52 |
|
" --helfandEcorr Helfand moment for thermal conductvity", |
53 |
+ |
" -p, --momentum Helfand momentum for viscosity", |
54 |
|
" --stresscorr Stress tensor correlation function", |
55 |
|
0 |
56 |
|
}; |
95 |
|
args_info->thetacorr_given = 0 ; |
96 |
|
args_info->drcorr_given = 0 ; |
97 |
|
args_info->helfandEcorr_given = 0 ; |
98 |
+ |
args_info->momentum_given = 0 ; |
99 |
|
args_info->stresscorr_given = 0 ; |
100 |
|
args_info->dynamicProps_group_counter = 0 ; |
101 |
|
} |
140 |
|
args_info->thetacorr_help = gengetopt_args_info_help[15] ; |
141 |
|
args_info->drcorr_help = gengetopt_args_info_help[16] ; |
142 |
|
args_info->helfandEcorr_help = gengetopt_args_info_help[17] ; |
143 |
< |
args_info->stresscorr_help = gengetopt_args_info_help[18] ; |
143 |
> |
args_info->momentum_help = gengetopt_args_info_help[18] ; |
144 |
> |
args_info->stresscorr_help = gengetopt_args_info_help[19] ; |
145 |
|
|
146 |
|
} |
147 |
|
|
183 |
|
clear_given (args_info); |
184 |
|
clear_args (args_info); |
185 |
|
init_args_info (args_info); |
186 |
+ |
|
187 |
+ |
args_info->inputs = 0; |
188 |
+ |
args_info->inputs_num = 0; |
189 |
|
} |
190 |
|
|
191 |
|
void |
224 |
|
static void |
225 |
|
cmdline_parser_release (struct gengetopt_args_info *args_info) |
226 |
|
{ |
227 |
< |
|
227 |
> |
unsigned int i; |
228 |
|
free_string_field (&(args_info->input_arg)); |
229 |
|
free_string_field (&(args_info->input_orig)); |
230 |
|
free_string_field (&(args_info->output_arg)); |
238 |
|
free_string_field (&(args_info->memory_orig)); |
239 |
|
|
240 |
|
|
241 |
+ |
for (i = 0; i < args_info->inputs_num; ++i) |
242 |
+ |
free (args_info->inputs [i]); |
243 |
+ |
|
244 |
+ |
if (args_info->inputs_num) |
245 |
+ |
free (args_info->inputs); |
246 |
|
|
247 |
|
clear_given (args_info); |
248 |
|
} |
305 |
|
write_into_file(outfile, "drcorr", 0, 0 ); |
306 |
|
if (args_info->helfandEcorr_given) |
307 |
|
write_into_file(outfile, "helfandEcorr", 0, 0 ); |
308 |
+ |
if (args_info->momentum_given) |
309 |
+ |
write_into_file(outfile, "momentum", 0, 0 ); |
310 |
|
if (args_info->stresscorr_given) |
311 |
|
write_into_file(outfile, "stresscorr", 0, 0 ); |
312 |
|
|
371 |
|
args_info->thetacorr_given = 0 ; |
372 |
|
args_info->drcorr_given = 0 ; |
373 |
|
args_info->helfandEcorr_given = 0 ; |
374 |
+ |
args_info->momentum_given = 0 ; |
375 |
|
args_info->stresscorr_given = 0 ; |
376 |
|
|
377 |
|
args_info->dynamicProps_group_counter = 0; |
631 |
|
{ "thetacorr", 0, NULL, 0 }, |
632 |
|
{ "drcorr", 0, NULL, 0 }, |
633 |
|
{ "helfandEcorr", 0, NULL, 0 }, |
634 |
+ |
{ "momentum", 0, NULL, 'p' }, |
635 |
|
{ "stresscorr", 0, NULL, 0 }, |
636 |
|
{ 0, 0, 0, 0 } |
637 |
|
}; |
638 |
|
|
639 |
< |
c = getopt_long (argc, argv, "hVi:o:m:rvdls", long_options, &option_index); |
639 |
> |
c = getopt_long (argc, argv, "hVi:o:m:rvdlsp", long_options, &option_index); |
640 |
|
|
641 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
642 |
|
|
759 |
|
&(local_args_info.sdcorr_given), optarg, 0, 0, ARG_NO, |
760 |
|
check_ambiguity, override, 0, 0, |
761 |
|
"sdcorr", 's', |
762 |
+ |
additional_error)) |
763 |
+ |
goto failure; |
764 |
+ |
|
765 |
+ |
break; |
766 |
+ |
case 'p': /* Helfand momentum for viscosity. */ |
767 |
+ |
|
768 |
+ |
if (args_info->dynamicProps_group_counter && override) |
769 |
+ |
reset_group_dynamicProps (args_info); |
770 |
+ |
args_info->dynamicProps_group_counter += 1; |
771 |
+ |
|
772 |
+ |
if (update_arg( 0 , |
773 |
+ |
0 , &(args_info->momentum_given), |
774 |
+ |
&(local_args_info.momentum_given), optarg, 0, 0, ARG_NO, |
775 |
+ |
check_ambiguity, override, 0, 0, |
776 |
+ |
"momentum", 'p', |
777 |
|
additional_error)) |
778 |
|
goto failure; |
779 |
|
|
937 |
|
if ( error ) |
938 |
|
return (EXIT_FAILURE); |
939 |
|
|
940 |
+ |
if (optind < argc) |
941 |
+ |
{ |
942 |
+ |
int i = 0 ; |
943 |
+ |
int found_prog_name = 0; |
944 |
+ |
/* whether program name, i.e., argv[0], is in the remaining args |
945 |
+ |
(this may happen with some implementations of getopt, |
946 |
+ |
but surely not with the one included by gengetopt) */ |
947 |
+ |
|
948 |
+ |
i = optind; |
949 |
+ |
while (i < argc) |
950 |
+ |
if (argv[i++] == argv[0]) { |
951 |
+ |
found_prog_name = 1; |
952 |
+ |
break; |
953 |
+ |
} |
954 |
+ |
i = 0; |
955 |
+ |
|
956 |
+ |
args_info->inputs_num = argc - optind - found_prog_name; |
957 |
+ |
args_info->inputs = |
958 |
+ |
(char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ; |
959 |
+ |
while (optind < argc) |
960 |
+ |
if (argv[optind++] != argv[0]) |
961 |
+ |
args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind-1]) ; |
962 |
+ |
} |
963 |
+ |
|
964 |
|
return 0; |
965 |
|
|
966 |
|
failure: |