summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2017-08-24 10:51:45 +0200
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2017-10-25 11:04:33 +0200
commita7e2f45e6d8eb6658ca28ead9192f6f384db40b1 (patch)
tree460c472e3028b31456a1d7860dd5141aa9bf0a83
parente78339dd2882c8a95ad41d8d47629b16efb0f227 (diff)
downloadmemtool-a7e2f45e6d8eb6658ca28ead9192f6f384db40b1.tar.gz
memtool-a7e2f45e6d8eb6658ca28ead9192f6f384db40b1.tar.xz
Implement a -V switch to get the version
-rw-r--r--memtool.17
-rw-r--r--memtool.c5
2 files changed, 12 insertions, 0 deletions
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) {