From patchwork Fri Jul 10 15:28:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11656847 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 32C2792A for ; Fri, 10 Jul 2020 15:29:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 17C6520849 for ; Fri, 10 Jul 2020 15:29:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="DZbOcOL0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728013AbgGJP3W (ORCPT ); Fri, 10 Jul 2020 11:29:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726832AbgGJP3W (ORCPT ); Fri, 10 Jul 2020 11:29:22 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A593EC08C5CE for ; Fri, 10 Jul 2020 08:29:21 -0700 (PDT) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1CC492C0; Fri, 10 Jul 2020 17:29:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594394959; bh=p86aJ8vHaxhnJfG97Tc0QbMgOVuh+7I/vEjm/kNAkEY=; h=From:To:Cc:Subject:Date:From; b=DZbOcOL0DGPi5wdeS6D1TSAcGDMSeJp5hpVext9F/Gw+nGOdW6PKykioQCK/Z/oyb X9XkucDq/dBeWexlZ8eUNQSgt1hzh1bEQb5ORjXLst69ecK3JVrFH+PrpDVE9+U0au XvJUH+NENCzpc9YmJQia4AwybCyWpYdws7eaSsw0= From: Paul Elder To: linux-media@vger.kernel.org Cc: Paul Elder , laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl Subject: [PATCH v2 1/6] v4l2-compliance: Add version command Date: Sat, 11 Jul 2020 00:28:53 +0900 Message-Id: <20200710152858.486326-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add a --version option to v4l2-compliance to retrieve the version of v4l2-compliance. While at it, factor out and reorder printing the SHA to after argument parsing. Signed-off-by: Paul Elder --- utils/v4l2-compliance/v4l2-compliance.cpp | 40 ++++++++++++++++------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index 4b45f110..dfffa184 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -79,6 +79,7 @@ enum Option { OptMediaBusInfo = 'z', OptStreamFrom = 128, OptStreamFromHdr, + OptVersion, OptLast = 256 }; @@ -153,9 +154,29 @@ static struct option long_options[] = { {"stream-all-formats", optional_argument, 0, OptStreamAllFormats}, {"stream-all-io", no_argument, 0, OptStreamAllIO}, {"stream-all-color", required_argument, 0, OptStreamAllColorTest}, + {"version", no_argument, 0, OptVersion}, {0, 0, 0, 0} }; +static void print_sha() +{ +#ifdef SHA +#define STR(x) #x +#define STRING(x) STR(x) + printf("v4l2-compliance SHA: %s", STRING(SHA)); +#else + printf("v4l2-compliance SHA: not available\n"); +#endif + + printf(", %zd bits, %zd-bit time_t\n", sizeof(void *) * 8, sizeof(time_t) * 8); + printf("\n"); +} + +static void version() +{ + printf("v4l2-compliance " PACKAGE_VERSION "\n"); +} + static void usage() { printf("Usage:\n"); @@ -244,6 +265,7 @@ static void usage() printf(" -P, --no-progress Turn off progress messages.\n"); printf(" -T, --trace Trace all called ioctls.\n"); printf(" -v, --verbose Turn on verbose reporting.\n"); + printf(" --version Show version information.\n"); #ifndef NO_LIBV4L2 printf(" -w, --wrapper Use the libv4l2 wrapper library.\n"); #endif @@ -1485,17 +1507,6 @@ int main(int argc, char **argv) char *value, *subs; int idx = 0; -#ifdef SHA -#define STR(x) #x -#define STRING(x) STR(x) - printf("v4l2-compliance SHA: %s", STRING(SHA)); -#else - printf("v4l2-compliance SHA: not available\n"); -#endif - - printf(", %zd bits, %zd-bit time_t\n", sizeof(void *) * 8, sizeof(time_t) * 8); - printf("\n"); - if (!env_media_apps_color || !strcmp(env_media_apps_color, "auto")) show_colors = isatty(STDOUT_FILENO); else if (!strcmp(env_media_apps_color, "always")) @@ -1664,6 +1675,10 @@ int main(int argc, char **argv) case OptNoProgress: no_progress = true; break; + case OptVersion: + version(); + print_sha(); + std::exit(EXIT_SUCCESS); case ':': fprintf(stderr, "Option `%s' requires a value\n", argv[optind]); @@ -1685,6 +1700,9 @@ int main(int argc, char **argv) usage(); std::exit(EXIT_FAILURE); } + + print_sha(); + bool direct = !options[OptUseWrapper]; int fd; From patchwork Fri Jul 10 15:28:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11656849 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 27C4F92A for ; Fri, 10 Jul 2020 15:29:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 05D7E20849 for ; Fri, 10 Jul 2020 15:29:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gwEx2KAf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728022AbgGJP3Y (ORCPT ); Fri, 10 Jul 2020 11:29:24 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:50752 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726832AbgGJP3Y (ORCPT ); Fri, 10 Jul 2020 11:29:24 -0400 Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8878B9B1; Fri, 10 Jul 2020 17:29:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594394962; bh=9A/atXH1YXfDrfH9zej5/expJA3ciqGtIoKfltEw+e4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gwEx2KAfu7Smhfl9UGhElT5GJ8o8D+wuKizCYX60P9SYD0EcxuZnjNR4uXb0t22Yn XGVJhM3JoF3DOEaBgeYN5Uu3sxFjkrJxIvHQ8lms9u097rOM+O1fSBZ1Ao2OTmnjyd ZvMTMxB0xDcU2Cmrou/FP94YedmHaLGJm+ANuq8Q= From: Paul Elder To: linux-media@vger.kernel.org Cc: Paul Elder , laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl Subject: [PATCH v2 2/6] v4l2-ctl: Add version command Date: Sat, 11 Jul 2020 00:28:54 +0900 Message-Id: <20200710152858.486326-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200710152858.486326-1-paul.elder@ideasonboard.com> References: <20200710152858.486326-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add a --version option to v4l2-ctl to retrieve the version of v4l2-ctl. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- 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(+) diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index 47f5da1a..9b785cbf 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -121,6 +121,7 @@ void common_usage() " --silent only set the result code, do not print any messages\n" " --sleep sleep , call QUERYCAP and close the file handle\n" " --verbose turn on verbose ioctl status reporting\n" + " --version show version information\n" ); } diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp index 4972591e..bc7330c4 100644 --- a/utils/v4l2-ctl/v4l2-ctl.cpp +++ b/utils/v4l2-ctl/v4l2-ctl.cpp @@ -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]); diff --git a/utils/v4l2-ctl/v4l2-ctl.h b/utils/v4l2-ctl/v4l2-ctl.h index 28e50471..27a3ca35 100644 --- a/utils/v4l2-ctl/v4l2-ctl.h +++ b/utils/v4l2-ctl/v4l2-ctl.h @@ -263,6 +263,7 @@ enum Option { OptHelpStreaming, OptHelpEdid, OptHelpAll, + OptVersion, OptLast = 512 }; From patchwork Fri Jul 10 15:28:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11656851 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE4E06C1 for ; Fri, 10 Jul 2020 15:29:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2A8420720 for ; Fri, 10 Jul 2020 15:29:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="alnlp+yA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728058AbgGJP30 (ORCPT ); Fri, 10 Jul 2020 11:29:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726832AbgGJP30 (ORCPT ); Fri, 10 Jul 2020 11:29:26 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 174E0C08C5CE for ; Fri, 10 Jul 2020 08:29:26 -0700 (PDT) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 04669B23; Fri, 10 Jul 2020 17:29:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594394964; bh=VT+PmWTgks/xjSUznT5Oqen9cCeSgx4fWV7GsEOjXG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=alnlp+yA6LyydcGGB54Y4eCic98+cC3W6MZNkFAMARQuggzznTO0zg+yZBoioiFdr hCufFNe+hAHDtkWZMO5NetMctB6xqqFSPtf0gFpV4Z4nw3gBW+vlXGl/SwQrk4KbM6 WphIizWQ01KoNjYlZUY12kDNhpMhpuKgqE/Xn3b0= From: Paul Elder To: linux-media@vger.kernel.org Cc: Paul Elder , laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl Subject: [PATCH v2 3/6] cec-compliance: Add version command Date: Sat, 11 Jul 2020 00:28:55 +0900 Message-Id: <20200710152858.486326-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200710152858.486326-1-paul.elder@ideasonboard.com> References: <20200710152858.486326-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add a --version option to cec-compliance to retrieve the version of cec-compliance. While at it, factor out printing the SHA. Signed-off-by: Paul Elder --- utils/cec-compliance/cec-compliance.cpp | 33 +++++++++++++++++++------ 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp index 0e5840c5..f954b31b 100644 --- a/utils/cec-compliance/cec-compliance.cpp +++ b/utils/cec-compliance/cec-compliance.cpp @@ -96,6 +96,8 @@ enum Option { OptSkipTestTunerControl, OptSkipTestVendorSpecificCommands, OptSkipTestStandbyResume, + + OptVersion, OptLast = 256 }; @@ -177,9 +179,27 @@ static struct option long_options[] = { {"skip-test-tuner-control", no_argument, 0, OptSkipTestTunerControl}, {"skip-test-vendor-specific-commands", no_argument, 0, OptSkipTestVendorSpecificCommands}, {"skip-test-standby-resume", no_argument, 0, OptSkipTestStandbyResume}, + {"version", no_argument, 0, OptVersion}, {0, 0, 0, 0} }; +static void print_sha() +{ +#ifdef SHA +#define STR(x) #x +#define STRING(x) STR(x) + printf("cec-compliance SHA : %s\n", STRING(SHA)); +#else + printf("cec-compliance SHA : not available\n"); +#endif + +} + +static void version() +{ + printf("cec-compliance " PACKAGE_VERSION "\n"); +} + static void usage() { printf("Usage:\n" @@ -234,6 +254,7 @@ static void usage() " -s, --skip-info Skip Driver Info output\n" " -T, --trace Trace all called ioctls\n" " -v, --verbose Turn on verbose reporting\n" + " --version Show version information\n" " -w, --wall-clock Show timestamps as wall-clock time (implies -v)\n" " -W, --exit-on-warn Exit on the first warning.\n" ); @@ -1261,6 +1282,10 @@ int main(int argc, char **argv) case OptVerbose: show_info = true; break; + case OptVersion: + version(); + print_sha(); + std::exit(EXIT_SUCCESS); case ':': fprintf(stderr, "Option '%s' requires a value\n", argv[optind]); @@ -1395,13 +1420,7 @@ int main(int argc, char **argv) if (options[OptInteractive]) test_tags |= TAG_INTERACTIVE; -#ifdef SHA -#define STR(x) #x -#define STRING(x) STR(x) - printf("cec-compliance SHA : %s\n", STRING(SHA)); -#else - printf("cec-compliance SHA : not available\n"); -#endif + print_sha(); node.phys_addr = CEC_PHYS_ADDR_INVALID; doioctl(&node, CEC_ADAP_G_PHYS_ADDR, &node.phys_addr); From patchwork Fri Jul 10 15:28:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11656853 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A72B6C1 for ; Fri, 10 Jul 2020 15:29:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 66C0E20720 for ; Fri, 10 Jul 2020 15:29:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="MY3pl8uZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728065AbgGJP33 (ORCPT ); Fri, 10 Jul 2020 11:29:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726832AbgGJP32 (ORCPT ); Fri, 10 Jul 2020 11:29:28 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87EF4C08C5CE for ; Fri, 10 Jul 2020 08:29:28 -0700 (PDT) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 73FC69B1; Fri, 10 Jul 2020 17:29:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594394967; bh=Whk1suoOgmf2WQVJN9qBm6EqkiQe7VJyA3plS0Ws1Is=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MY3pl8uZ9TbOHK6baKIxFIGfvveWA4PqHjW99ZeGi08q1rhFAhHkN7/QxtZRw76Yr IVubEYNCCCmbZjmgvz2TE1H6pS2vjBEN7ogmjB0owG60SCLZussgQ4kNh5WYT6/URW OBjbTRiCNFebNl8pFV7yQvmFn6iGm4Xor8suj3FA= From: Paul Elder To: linux-media@vger.kernel.org Cc: Paul Elder , laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl Subject: [PATCH v2 4/6] cec-ctl: Add version command Date: Sat, 11 Jul 2020 00:28:56 +0900 Message-Id: <20200710152858.486326-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200710152858.486326-1-paul.elder@ideasonboard.com> References: <20200710152858.486326-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add a --version option to cec-ctl to retrieve the version of cec-ctl. Signed-off-by: Paul Elder --- utils/cec-ctl/cec-ctl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index 455cdaeb..d4a4f036 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -133,6 +133,7 @@ enum Option { OptVendorCommandWithID, OptVendorRemoteButtonDown, OptCustomCommand, + OptVersion, }; struct node { @@ -218,6 +219,8 @@ static struct option long_options[] = { { "unregistered", no_argument, 0, OptUnregistered }, { "help-all", no_argument, 0, OptHelpAll }, + { "version", no_argument, 0, OptVersion }, + CEC_PARSE_LONG_OPTS { "vendor-remote-button-down", required_argument, 0, OptVendorRemoteButtonDown }, \ @@ -231,6 +234,11 @@ static struct option long_options[] = { { 0, 0, 0, 0 } }; +static void version() +{ + printf("cec-ctl " PACKAGE_VERSION "\n"); +} + static void usage() { printf("Usage:\n" @@ -262,6 +270,7 @@ static void usage() " --help-all Show all help messages\n" " -T, --trace Trace all called ioctls\n" " -v, --verbose Turn on verbose reporting\n" + " --version Show version information\n" " -w, --wall-clock Show timestamps as wall-clock time (implies -v)\n" " -W, --wait-for-msgs Wait for messages and events for up to --monitor-time secs.\n" " --cec-version-1.4 Use CEC Version 1.4 instead of 2.0\n" @@ -2296,6 +2305,10 @@ int main(int argc, char **argv) break; } + case OptVersion: + version(); + std::exit(EXIT_SUCCESS); + default: if (ch >= OptHelpAll) { cec_parse_usage_options(options); From patchwork Fri Jul 10 15:28:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11656855 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BB366C1 for ; Fri, 10 Jul 2020 15:29:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC4AF2083B for ; Fri, 10 Jul 2020 15:29:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="HlESv3tm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728067AbgGJP3b (ORCPT ); Fri, 10 Jul 2020 11:29:31 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:50770 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726832AbgGJP3b (ORCPT ); Fri, 10 Jul 2020 11:29:31 -0400 Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E36AA2C0; Fri, 10 Jul 2020 17:29:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594394969; bh=8YpS6M62rzCTKd8bpWa38Z1F4L8DhLSDvcPeqDKa5Ho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HlESv3tmhLTnj/nRcCnf+VFIJPnabnpVmtYko2yd5kcTGAqNjCam8CRDwGbRa/MnD l7ulfjIs4zWUUlsGlda1exluxu6p7hUcnV4watqxaSeoeiovgcZ9aLpjdNQIszbyT7 QgyaBnphsnrZKoW6YFG3uksa9eOqG/3XaHWZ85RQ= From: Paul Elder To: linux-media@vger.kernel.org Cc: Paul Elder , laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl Subject: [PATCH v2 5/6] cec-follower: Add version command Date: Sat, 11 Jul 2020 00:28:57 +0900 Message-Id: <20200710152858.486326-5-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200710152858.486326-1-paul.elder@ideasonboard.com> References: <20200710152858.486326-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add a --version option to cec-follower to retrieve the version of cec-follower. Signed-off-by: Paul Elder --- utils/cec-follower/cec-follower.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp index 9cead57a..34663f5b 100644 --- a/utils/cec-follower/cec-follower.cpp +++ b/utils/cec-follower/cec-follower.cpp @@ -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 and opcode\n" " . 'all' can be used for or 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]); From patchwork Fri Jul 10 15:28:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11656857 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EDAFA92A for ; Fri, 10 Jul 2020 15:29:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C66582078B for ; Fri, 10 Jul 2020 15:29:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="me7A1naI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728089AbgGJP3d (ORCPT ); Fri, 10 Jul 2020 11:29:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726832AbgGJP3d (ORCPT ); Fri, 10 Jul 2020 11:29:33 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 742F6C08C5CE for ; Fri, 10 Jul 2020 08:29:33 -0700 (PDT) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5F2629B1; Fri, 10 Jul 2020 17:29:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594394972; bh=2c5DqY/D9UWKF7DFmRgu0m5XhHNAY/LzzjurIsk78sI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=me7A1naIRGpG2d7sDyniQW8+Y4KIpZsurjEhjivpMU25mPetgmNIpadGDM+GAZUvc cBh8WEmd7Imz/e0SjqCXK7DJhv40Mcl+vOI/4wSYygr4QwdX0QnkTAAL8c+ZrDsuCF TkyQu3YQXu2M5zCXriIU9gYIXIAnvbA4XPOd5+To= From: Paul Elder To: linux-media@vger.kernel.org Cc: Paul Elder , laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl Subject: [PATCH v2 6/6] media-ctl: Add version command Date: Sat, 11 Jul 2020 00:28:58 +0900 Message-Id: <20200710152858.486326-6-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200710152858.486326-1-paul.elder@ideasonboard.com> References: <20200710152858.486326-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add a --version option to media-ctl to retrieve the version of media-ctl. Signed-off-by: Paul Elder --- utils/media-ctl/options.c | 12 ++++++++++++ utils/media-ctl/options.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/utils/media-ctl/options.c b/utils/media-ctl/options.c index fb923775..3346ecb1 100644 --- a/utils/media-ctl/options.c +++ b/utils/media-ctl/options.c @@ -42,6 +42,11 @@ struct media_options media_opts = { .devname = MEDIA_DEVNAME_DEFAULT, }; +static void version() +{ + printf("media-ctl " PACKAGE_VERSION "\n"); +} + static void usage(const char *argv0) { unsigned int i; @@ -66,6 +71,7 @@ static void usage(const char *argv0) printf(" --print-dot Print the device topology as a dot graph\n"); printf("-r, --reset Reset all links to inactive\n"); printf("-v, --verbose Be verbose\n"); + printf(" --version Show version information\n"); printf("\n"); printf("Links and formats are defined as\n"); printf("\tlinks = link { ',' link } ;\n"); @@ -127,6 +133,7 @@ static void usage(const char *argv0) #define OPT_SET_DV 258 #define OPT_LIST_KNOWN_MBUS_FMTS 259 #define OPT_GET_DV 260 +#define OPT_VERSION 261 static struct option opts[] = { {"device", 1, 0, 'd'}, @@ -145,6 +152,7 @@ static struct option opts[] = { {"print-topology", 0, 0, 'p'}, {"reset", 0, 0, 'r'}, {"verbose", 0, 0, 'v'}, + {"version", 0, 0, OPT_VERSION}, { }, }; @@ -287,6 +295,10 @@ int parse_cmdline(int argc, char **argv) list_known_mbus_formats(); exit(0); + case OPT_VERSION: + version(); + exit(0); + default: printf("Invalid option -%c\n", opt); printf("Run %s -h for help.\n", argv[0]); diff --git a/utils/media-ctl/options.h b/utils/media-ctl/options.h index 7e0556fc..b1751f56 100644 --- a/utils/media-ctl/options.h +++ b/utils/media-ctl/options.h @@ -22,6 +22,8 @@ #ifndef __OPTIONS_H #define __OPTIONS_H +#include + struct media_options { const char *devname;