]> www.infradead.org Git - mtd-utils.git/commitdiff
flash_{un,}lock: support --version flag
authorBrian Norris <computersforpeace@gmail.com>
Thu, 27 Aug 2015 20:32:25 +0000 (13:32 -0700)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 11 Nov 2015 22:05:36 +0000 (14:05 -0800)
Just use the common helper macro.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
flash_unlock.c

index 777e4375a44db7273a3ab9b4ee56caf124d954d7..9a24b5f796e0481bd967ef5333aac01bb7ef7514 100644 (file)
@@ -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;