From 5038c54d371c02a264f5cbef4e092bf4da6ef5f2 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 14 Nov 2025 19:50:19 -0500 Subject: Add -V/--version opt. --- src/unalf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/unalf.c') diff --git a/src/unalf.c b/src/unalf.c index af74af0..39685e7 100644 --- a/src/unalf.c +++ b/src/unalf.c @@ -7,10 +7,6 @@ #include #include "unalf.h" -#ifndef VERSION -#define VERSION "0.0.0" -#endif - FILE *in_file, *out_file; char *in_filename, *self; opts_t opts; @@ -67,6 +63,11 @@ int main(int argc, char **argv) { if(argc < 2 || !strcmp(argv[1], "--help") || !strcmp(argv[1], "-h")) usage(); + if(!strcmp(argv[1], "--version")) { + puts(VERSION); + exit(0); + } + parse_opts(argc, argv); if(!(in_file = fopen(in_filename, "rb"))) { -- cgit v1.2.3