diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-31 13:15:43 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-31 13:15:43 +0900 |
| commit | c84b5ccd48ca188f439cde3e5cdac95d26ed0be3 (patch) | |
| tree | 1478ed798efd41bce3cbcacf3b9c375f391beb17 /src | |
| parent | da65f1e21a24f0a173ee5ae08f00db91cba5ffda (diff) | |
| download | ducc-c84b5ccd48ca188f439cde3e5cdac95d26ed0be3.tar.gz ducc-c84b5ccd48ca188f439cde3e5cdac95d26ed0be3.tar.zst ducc-c84b5ccd48ca188f439cde3e5cdac95d26ed0be3.zip | |
feat: support --version flagv0.1.0
Diffstat (limited to 'src')
| -rw-r--r-- | src/cli.c | 8 | ||||
| -rw-r--r-- | src/std.h | 1 | ||||
| -rw-r--r-- | src/version.h | 6 |
3 files changed, 15 insertions, 0 deletions
@@ -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]); } @@ -26,6 +26,7 @@ void* memcpy(void*, const void*, size_t); void* memmove(void*, const void*, size_t); void* memset(void*, int, size_t); int mkstemps(char*, int); +int printf(const char*, ...); void* realloc(void*, size_t); int sprintf(char*, const char*, ...); int strcmp(const char*, const char*); diff --git a/src/version.h b/src/version.h new file mode 100644 index 0000000..8f8b201 --- /dev/null +++ b/src/version.h @@ -0,0 +1,6 @@ +#ifndef DUCC_VERSION_H +#define DUCC_VERSION_H + +#define DUCC_VERSION "0.1.0" + +#endif |
