From a7e2f45e6d8eb6658ca28ead9192f6f384db40b1 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Thu, 24 Aug 2017 10:51:45 +0200 Subject: Implement a -V switch to get the version --- memtool.1 | 7 +++++++ memtool.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/memtool.1 b/memtool.1 index f18ba12..0bc0ec3 100644 --- a/memtool.1 +++ b/memtool.1 @@ -2,6 +2,8 @@ .SH NAME memtool \- display and modify memory .SH SYNOPSIS +.B memtool -V +.br .B memtool md .RB [\| \-b \||\| \-w \||\| \-l \||\| \-q \|] .RB [\| \-x \|] @@ -35,6 +37,11 @@ the tool, but either the machine or the caller. .SH OPTIONS .TP +.B \-V +Dump memtool version and exit + +.SH COMMON OPTIONS FOR SUBCOMMANDS +.TP .B \-b Use byte wise (8-bit) access .TP diff --git a/memtool.c b/memtool.c index b790c8e..9dc594d 100644 --- a/memtool.c +++ b/memtool.c @@ -479,6 +479,11 @@ int main(int argc, char **argv) if (!strcmp(basename(argv[0]), "memtool")) { argv++; argc--; + + if (!strcmp(argv[0], "-V")) { + printf("%s\n", PACKAGE_STRING); + return EXIT_SUCCESS; + } } if (argc < 1) { -- cgit v1.2.3