diff options
author | Bill Richardson <wfrichar@chromium.org> | 2014-10-30 17:41:51 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-31 20:55:24 +0000 |
commit | e1486c3234b7dc6fc5b58681b271a65a09141e20 (patch) | |
tree | 34b0d3f6344cf168605547772bec9d7d0b113e32 /futility | |
parent | d274a2e9536907d0474d988f32f602cd64ed1ae6 (diff) | |
download | vboot_reference-e1486c3234b7dc6fc5b58681b271a65a09141e20.tar.gz |
futility: add version command
BUG=none
BRANCH=none
TEST=manual
make && ./build/futility/futility version
Change-Id: I362b13d3befba62a33bc9fd2e87ad68f4bc62a84
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226779
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'futility')
-rw-r--r-- | futility/futility.c | 10 | ||||
-rw-r--r-- | futility/futility.h | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/futility/futility.c b/futility/futility.c index b4070618..c74bba61 100644 --- a/futility/futility.c +++ b/futility/futility.c @@ -237,6 +237,16 @@ DECLARE_FUTIL_COMMAND(help, do_help, "Show a bit of help (you're looking at it)", print_help); +static int do_version(int argc, char *argv[]) +{ + printf("%s\n", futility_version); + return 0; +} + +DECLARE_FUTIL_COMMAND(version, do_version, + "Show the futility source revision and build date", + NULL); + /* * These are built-in functions that we'd like to abandon completely someday. * TODO: If no one complains, get rid of them. diff --git a/futility/futility.h b/futility/futility.h index 52c007cc..652b5fbc 100644 --- a/futility/futility.h +++ b/futility/futility.h @@ -14,6 +14,9 @@ /* This program */ #define MYNAME "futility" +/* Version string (autogenerated) */ +extern const char futility_version[]; + /* Here's a structure to define the commands that futility implements. */ struct futil_cmd_t { const char *const name; |