diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2017-08-24 10:51:45 +0200 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2017-10-25 11:04:33 +0200 |
commit | a7e2f45e6d8eb6658ca28ead9192f6f384db40b1 (patch) | |
tree | 460c472e3028b31456a1d7860dd5141aa9bf0a83 | |
parent | e78339dd2882c8a95ad41d8d47629b16efb0f227 (diff) | |
download | memtool-a7e2f45e6d8eb6658ca28ead9192f6f384db40b1.tar.gz memtool-a7e2f45e6d8eb6658ca28ead9192f6f384db40b1.tar.xz |
Implement a -V switch to get the version
-rw-r--r-- | memtool.1 | 7 | ||||
-rw-r--r-- | memtool.c | 5 |
2 files changed, 12 insertions, 0 deletions
@@ -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 @@ -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) { |