[PATCH mtd-utils 03/11] flash_{un,}lock: support --version flag

Brian Norris computersforpeace at gmail.com
Mon Aug 31 15:34:24 PDT 2015


Just use the common helper macro.

Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 flash_unlock.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/flash_unlock.c b/flash_unlock.c
index 777e4375a44d..9a24b5f796e0 100644
--- a/flash_unlock.c
+++ b/flash_unlock.c
@@ -39,6 +39,7 @@ static void usage(int status)
 static const char short_opts[] = "h";
 static const struct option long_opts[] = {
 	{ "help",	no_argument,	0, 'h' },
+	{ "version",	no_argument,	0, 'v' },
 	{ NULL,		0,		0, 0 },
 };
 
@@ -61,6 +62,9 @@ int main(int argc, char *argv[])
 		case 'h':
 			usage(0);
 			break;
+		case 'v':
+			common_print_version();
+			exit(0);
 		default:
 			usage(1);
 			break;
-- 
2.5.0.457.gab17608




More information about the linux-mtd mailing list