From: Brian Norris Date: Thu, 27 Aug 2015 20:32:25 +0000 (-0700) Subject: flash_{un,}lock: support --version flag X-Git-Tag: v2.0.0-rc1~70 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=136ee37a3ec6d91b326b2efbead27c91fc0863b5;p=mtd-utils.git flash_{un,}lock: support --version flag Just use the common helper macro. Signed-off-by: Brian Norris --- diff --git a/flash_unlock.c b/flash_unlock.c index 777e437..9a24b5f 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;