From a9c31317048a4f1688d253bf158d75bfe068f703 Mon Sep 17 00:00:00 2001 From: Tim Segers Date: Mon, 8 Dec 2025 09:31:13 +0100 Subject: Add version command --- src/tweetpipe.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tweetpipe.c b/src/tweetpipe.c index 768faaf..ffeb18b 100644 --- a/src/tweetpipe.c +++ b/src/tweetpipe.c @@ -5,9 +5,10 @@ static struct option getopt_long_options[] = { { "help", 0, NULL, 'h' }, { "decrypt", 0, NULL, 'd' }, { "encrypt", 0, NULL, 'e' }, { "in", 1, NULL, 'i' }, { "out", 1, NULL, 'o' }, { "pass", 1, NULL, 'p' }, - { "passfile", 1, NULL, 'P' }, { "passgen", 0, NULL, 'G' }, { NULL, 0, NULL, 0 } + { "passfile", 1, NULL, 'P' }, { "passgen", 0, NULL, 'G' }, { "version", 0, NULL, 'v' }, + { NULL, 0, NULL, 0 } }; -static const char *getopt_options = "hdeGi:o:p:P:"; +static const char *getopt_options = "hdeGvi:o:p:P:"; static void usage(FILE *stream) @@ -316,6 +317,10 @@ options_parse(Context *ctx, int argc, char *argv[]) case 'P': read_password_file(ctx, optarg); break; + case 'v': + printf("%s\n", VERSION_STRING); + exit(0); + break; /* NOTREACHED */ default: usage(stderr); } -- cgit v1.2.3-70-g09d2