aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cli.c
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-08-31 13:15:43 +0900
committernsfisis <nsfisis@gmail.com>2025-08-31 13:15:43 +0900
commitc84b5ccd48ca188f439cde3e5cdac95d26ed0be3 (patch)
tree1478ed798efd41bce3cbcacf3b9c375f391beb17 /src/cli.c
parentda65f1e21a24f0a173ee5ae08f00db91cba5ffda (diff)
downloadducc-c84b5ccd48ca188f439cde3e5cdac95d26ed0be3.tar.gz
ducc-c84b5ccd48ca188f439cde3e5cdac95d26ed0be3.tar.zst
ducc-c84b5ccd48ca188f439cde3e5cdac95d26ed0be3.zip
feat: support --version flagv0.1.0
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]);
}