aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Duggan <aduggan@synaptics.com>2014-11-12 11:37:42 -0800
committerAndrew Duggan <aduggan@synaptics.com>2014-11-12 11:37:42 -0800
commitd2e1d579bda5c1d89bd9d23a940982ac92d8dc2e (patch)
tree1a7273d29827ef2495e525da0936983a075a2157
parentdca0efccd6af2dbe14937f8560c434180c10a567 (diff)
downloadplatform_external_rmi4utils-d2e1d579bda5c1d89bd9d23a940982ac92d8dc2e.tar.gz
platform_external_rmi4utils-d2e1d579bda5c1d89bd9d23a940982ac92d8dc2e.tar.bz2
platform_external_rmi4utils-d2e1d579bda5c1d89bd9d23a940982ac92d8dc2e.zip
Add a version number
-rw-r--r--rmi4update/main.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/rmi4update/main.cpp b/rmi4update/main.cpp
index 766d95d..0cc8360 100644
--- a/rmi4update/main.cpp
+++ b/rmi4update/main.cpp
@@ -31,7 +31,11 @@
#include "hiddevice.h"
#include "rmi4update.h"
-#define RMI4UPDATE_GETOPTS "hfd:pl"
+#define VERSION_MAJOR 1
+#define VERSION_MINOR 0
+#define VERSION_SUBMINOR 0
+
+#define RMI4UPDATE_GETOPTS "hfd:plv"
void printHelp(const char *prog_name)
{
@@ -41,6 +45,13 @@ void printHelp(const char *prog_name)
fprintf(stdout, "\t-d, --device\thidraw device file associated with the device being updated.\n");
fprintf(stdout, "\t-p, --fw-props\tPrint the firmware properties.\n");
fprintf(stdout, "\t-l, --lockdown\tPerform lockdown.\n");
+ fprintf(stdout, "\t-v, --version\tPrint version number.\n");
+}
+
+void printVersion()
+{
+ fprintf(stdout, "rmi4update version %d.%d.%d\n",
+ VERSION_MAJOR, VERSION_MINOR, VERSION_SUBMINOR);
}
int UpdateDevice(FirmwareImage & image, bool force, bool performLockdown, const char * deviceFile)
@@ -207,6 +218,7 @@ int main(int argc, char **argv)
{"device", 1, NULL, 'd'},
{"fw-props", 0, NULL, 'p'},
{"lockdown", 0, NULL, 'l'},
+ {"version", 0, NULL, 'v'},
{0, 0, 0, 0},
};
struct dirent * devDirEntry;
@@ -231,6 +243,9 @@ int main(int argc, char **argv)
case 'l':
performLockdown = true;
break;
+ case 'v':
+ printVersion();
+ return 0;
default:
break;