X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwgtpkg-installer.c;h=6738192c0ec3563f05a553c7c420c72687504c96;hb=2bbe66dda7fadf2d08a57e2b0e0fa8841a118c81;hp=855e28d6e35dc2ffd323886132759450be39a255;hpb=ab0ac254cc142f25bec0d5a6250856ad15bbbc82;p=src%2Fapp-framework-main.git diff --git a/src/wgtpkg-installer.c b/src/wgtpkg-installer.c index 855e28d..6738192 100644 --- a/src/wgtpkg-installer.c +++ b/src/wgtpkg-installer.c @@ -39,6 +39,20 @@ static const char appname[] = "wgtpkg-installer"; static const char *root; static int force; +static void version() +{ + printf( + "\n" + " %s version="AFM_VERSION"\n" + "\n" + " Copyright (C) 2015, 2016, 2017 \"IoT.bzh\"\n" + " AFB comes with ABSOLUTELY NO WARRANTY.\n" + " Licence Apache 2\n" + "\n", + appname + ); +} + static void usage() { printf( @@ -49,6 +63,7 @@ static void usage() " -f force overwriting\n" " -q quiet\n" " -v verbose\n" + " -V version\n" "\n", appname ); @@ -60,6 +75,7 @@ static struct option options[] = { { "help", no_argument, NULL, 'h' }, { "quiet", no_argument, NULL, 'q' }, { "verbose", no_argument, NULL, 'v' }, + { "version", no_argument, NULL, 'V' }, { NULL, 0, NULL, 0 } }; @@ -75,7 +91,7 @@ int main(int ac, char **av) force = 0; for (;;) { - i = getopt_long(ac, av, "hfqvp:", options, NULL); + i = getopt_long(ac, av, "hfqvVp:", options, NULL); if (i < 0) break; switch (i) { @@ -92,6 +108,9 @@ int main(int ac, char **av) case 'v': verbosity++; break; + case 'V': + version(); + return 0; case 'p': rc = grant_permission_list(optarg); if (rc < 0) {