summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich Ölmann <u.oelmann@pengutronix.de>2019-02-03 22:48:00 +0100
committerRoland Hieber <rhi@pengutronix.de>2019-02-07 12:34:15 +0100
commit15786485ab8b834a325b50e1ef6883aba0c0ceaa (patch)
tree303531df2917145255945b50afdbd2a97b72df3c
parent52221e50b0df0e7de75c20cc7e1fee045e7cca14 (diff)
downloaddt-utils-15786485ab8b834a325b50e1ef6883aba0c0ceaa.tar.gz
dt-utils-15786485ab8b834a325b50e1ef6883aba0c0ceaa.tar.xz
barebox-state: add cmdline option "--version"
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
-rw-r--r--src/barebox-state.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/barebox-state.c b/src/barebox-state.c
index 0f40044..4e087b9 100644
--- a/src/barebox-state.c
+++ b/src/barebox-state.c
@@ -366,6 +366,7 @@ struct state *state_get(const char *name, bool readonly, bool auth)
enum opt {
OPT_DUMP_SHELL = UCHAR_MAX + 1,
+ OPT_VERSION = UCHAR_MAX + 2,
};
static struct option long_options[] = {
@@ -377,6 +378,7 @@ static struct option long_options[] = {
{"force", no_argument, 0, 'f' },
{"verbose", no_argument, 0, 'v' },
{"quiet", no_argument, 0, 'q' },
+ {"version", no_argument, 0, OPT_VERSION },
{"help", no_argument, 0, 'h' },
{ }
};
@@ -394,6 +396,7 @@ static void usage(char *name)
"-f, --force do not check for state manipulation via the HMAC\n"
"-v, --verbose increase verbosity\n"
"-q, --quiet decrease verbosity\n"
+"--version display version\n"
"-h, --help this help\n",
name);
}
@@ -439,6 +442,9 @@ int main(int argc, char *argv[])
case 'h':
usage(argv[0]);
exit(0);
+ case OPT_VERSION:
+ printf(PACKAGE_STRING "\n");
+ exit(0);
case 'g':
sg = xzalloc(sizeof(*sg));
sg->get = 1;