@@ -46,6 +46,7 @@ enum Option {
OptShowState = 's',
OptWallClock = 'w',
OptServiceByDigID = 128,
+ OptVersion,
OptLast = 256
};
@@ -70,10 +71,16 @@ static struct option long_options[] = {
{ "wall-clock", no_argument, 0, OptWallClock },
{ "service-by-dig-id", no_argument, 0, OptServiceByDigID },
{ "ignore", required_argument, 0, OptIgnore },
+ { "version", no_argument, 0, OptVersion },
{ 0, 0, 0, 0 }
};
+static void version()
+{
+ printf("cec-follower " PACKAGE_VERSION "\n");
+}
+
static void usage()
{
printf("Usage:\n"
@@ -93,6 +100,7 @@ static void usage()
" Ignore messages from logical address <la> and opcode\n"
" <opcode>. 'all' can be used for <la> or <opcode> to match\n"
" all logical addresses or opcodes.\n"
+ " --version Show version information\n"
);
}
@@ -427,6 +435,9 @@ int main(int argc, char **argv)
show_msgs = true;
show_state = true;
break;
+ case OptVersion:
+ version();
+ std::exit(EXIT_SUCCESS);
case ':':
fprintf(stderr, "Option '%s' requires a value\n",
argv[optind]);