Print the list of models in the emulator

This commit is contained in:
Rodrigo Arias 2023-11-13 16:33:05 +01:00
parent 927837df25
commit effdf36f7e
3 changed files with 14 additions and 0 deletions

View File

@ -6,6 +6,7 @@
#include "common.h"
#include "ovni.h"
#include "path.h"
#include "models.h"
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
@ -37,6 +38,9 @@ usage(void)
rerr(" tracedir The output trace dir generated by ovni.\n");
rerr("\n");
rerr("The output PRV files are placed in the tracedir directory.\n");
rerr("\n");
rerr("Available emulation models:\n");
models_print();
exit(EXIT_FAILURE);
}

View File

@ -50,3 +50,12 @@ models_get_version(const char *name)
return NULL;
}
void
models_print(void)
{
for (int i = 0; models[i] != NULL; i++) {
struct model_spec *spec = models[i];
rerr(" %c %-8s %s\n", spec->model, spec->name, spec->version);
}
}

View File

@ -9,5 +9,6 @@ struct model;
USE_RET int models_register(struct model *model);
USE_RET const char *models_get_version(const char *name);
void models_print(void);
#endif /* MODELS_H */