aboutsummaryrefslogtreecommitdiff
path: root/src/cli/commands.c
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2022-07-02 14:51:29 +0200
committerJan200101 <sentrycraft123@gmail.com>2022-07-02 14:51:29 +0200
commitb4dc459669ac1c97dcf157a7606afcb4c967bb00 (patch)
tree31c2541c0a30d719cbe6b243e481bbd6faabba2f /src/cli/commands.c
parent62511367857a6f34f6b2f81dc094f9d632ad01bd (diff)
downloadOFQT-b4dc459669ac1c97dcf157a7606afcb4c967bb00.tar.gz
OFQT-b4dc459669ac1c97dcf157a7606afcb4c967bb00.zip
add version info to OFCL
Diffstat (limited to 'src/cli/commands.c')
-rw-r--r--src/cli/commands.c8
1 files changed, 8 insertions, 0 deletions
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();