From b4dc459669ac1c97dcf157a7606afcb4c967bb00 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sat, 2 Jul 2022 14:51:29 +0200 Subject: add version info to OFCL --- src/cli/commands.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cli/commands.c b/src/cli/commands.c index d206865..85b05c2 100644 --- a/src/cli/commands.c +++ b/src/cli/commands.c @@ -13,12 +13,14 @@ static int install(int, char**); static int update(int, char**); static int run(int, char**); +static int version(int, char**); static int info(int, char**); const struct Command commands[] = { { .name = "install", .func = install, .description = "Install OpenFortress"}, { .name = "update", .func = update, .description = "Update an existing install"}, { .name = "run", .func = run, .description = "Run OpenFortress"}, + { .name = "version", .func = version, .description = "Display the OFCL version"}, { .name = "info", .func = info, .description = "Show info about the current setup"}, }; const size_t commands_size = ARRAY_LEN(commands); @@ -218,6 +220,12 @@ static int run(int c, char** v) return exit_val; } +static int version(int c, char** v) +{ + puts(VERSION); + return EXIT_SUCCESS; +} + static int info(int c, char** v) { char* of_dir = getOpenFortressDir(); -- cgit v1.2.3