@@ -121,6 +121,7 @@ void common_usage()
" --silent only set the result code, do not print any messages\n"
" --sleep <secs> sleep <secs>, call QUERYCAP and close the file handle\n"
" --verbose turn on verbose ioctl status reporting\n"
+ " --version show version information\n"
);
}
@@ -284,6 +284,7 @@ static struct option long_options[] = {
{"stream-out-user", optional_argument, 0, OptStreamOutUser},
{"stream-out-dmabuf", no_argument, 0, OptStreamOutDmaBuf},
{"list-patterns", no_argument, 0, OptListPatterns},
+ {"version", no_argument, 0, OptVersion},
{0, 0, 0, 0}
};
@@ -306,6 +307,11 @@ static void usage_all()
edid_usage();
}
+static void version()
+{
+ printf("v4l2-ctl " PACKAGE_VERSION "\n");
+}
+
int test_ioctl(int fd, unsigned long cmd, void *arg)
{
return options[OptUseWrapper] ? v4l2_ioctl(fd, cmd, arg) : ioctl(fd, cmd, arg);
@@ -1245,6 +1251,9 @@ int main(int argc, char **argv)
case OptSleep:
secs = strtoul(optarg, 0L, 0);
break;
+ case OptVersion:
+ version();
+ return 0;
case ':':
fprintf(stderr, "Option '%s' requires a value\n",
argv[optind]);
@@ -263,6 +263,7 @@ enum Option {
OptHelpStreaming,
OptHelpEdid,
OptHelpAll,
+ OptVersion,
OptLast = 512
};
Add a --version option to v4l2-ctl to retrieve the version of v4l2-ctl. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> --- utils/v4l2-ctl/v4l2-ctl-common.cpp | 1 + utils/v4l2-ctl/v4l2-ctl.cpp | 9 +++++++++ utils/v4l2-ctl/v4l2-ctl.h | 1 + 3 files changed, 11 insertions(+)