aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cli.c b/src/cli.c
index d4297aa..a55d17e 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -1,5 +1,10 @@
#include "cli.h"
#include "common.h"
+#include "version.h"
+
+static void print_version() {
+ printf("ducc v%s\n", DUCC_VERSION);
+}
CliArgs* parse_cli_args(int argc, char** argv) {
const char* output_filename = NULL;
@@ -29,6 +34,9 @@ CliArgs* parse_cli_args(int argc, char** argv) {
only_compile = TRUE;
} else if (strcmp(argv[i], "-MMD") == 0) {
generate_deps = TRUE;
+ } else if (strcmp(argv[i], "--version") == 0) {
+ print_version();
+ exit(0);
} else {
fatal_error("unknown option: %s", argv[i]);
}