From 1009674513d09af1a699a8bf0f646c7130d7a0ac Mon Sep 17 00:00:00 2001 From: Kevin Cheng Date: Wed, 20 Oct 2021 19:51:41 +0000 Subject: Add version to reference model - update serialization_lib hash - check model version against serializer version - add "-v" to command line option to print out model version Signed-off-by: Kevin Cheng Change-Id: I554cf0fdead22e7e5f91d2e98831459286c40a2d --- reference_model/src/func_config.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'reference_model/src/func_config.cc') diff --git a/reference_model/src/func_config.cc b/reference_model/src/func_config.cc index bd1ce32..6880829 100644 --- a/reference_model/src/func_config.cc +++ b/reference_model/src/func_config.cc @@ -428,6 +428,7 @@ int func_model_print_help(FILE* out) fprintf(out, "\t-d - parse as file of config options\n"); + fprintf(out, "\t-v - Print refererence model version\n"); fprintf(out, "\t-h - show this help message and exit\n"); fprintf( out, @@ -459,7 +460,8 @@ static const char* get_arg_text(int& index, const int argc, const char** argv) } // Read the command line arguments -int func_model_parse_cmd_line(func_config_t* func_config, func_debug_t* func_debug, const int argc, const char** argv) +int func_model_parse_cmd_line( + func_config_t* func_config, func_debug_t* func_debug, const int argc, const char** argv, const char* version) { int i; programname = argv[0]; @@ -542,6 +544,11 @@ int func_model_parse_cmd_line(func_config_t* func_config, func_debug_t* func_deb func_debug_set_file(func_debug, get_arg_text(i, argc, argv)); break; } + case 'v': + { + fprintf(stdout, "Model Version %s\n", version); + return 1; + } default: func_model_print_help(stderr); ARG_ERROR("Unrecognized argument at position %d: %s", i, argv[i]); -- cgit v1.2.1