From patchwork Sat Jul 11 05:24:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 65385 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1ju9Rp-00ANpg-KQ; Sat, 11 Jul 2020 06:57:24 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726973AbgGKFY2 (ORCPT + 1 other); Sat, 11 Jul 2020 01:24:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726786AbgGKFY2 (ORCPT ); Sat, 11 Jul 2020 01:24: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 8679BC08C5DD for ; Fri, 10 Jul 2020 22:24:27 -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 B29A62FD; Sat, 11 Jul 2020 07:24:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594445065; bh=GQ0UKwuElZ86bFSHuqmWhD/73vBUmM9CvnlidCyMDXw=; h=From:To:Cc:Subject:Date:From; b=mNOm2lXFRDg0vN9Yf6NGRPTCRcGuP/etEKoegRa/Pd8rwgj6KibP8wQr6bX6I+7sS TLUHGkoLJs8dEyq/dPUg3OG8/ELxVvINczb4E7thaTJYdtMP8woEaWtCtr1XSwcscV GUMjzsB6ZbWspwclKLHEEAmWZNkHl2RT3tF2eRd4= From: Paul Elder To: linux-media@vger.kernel.org Cc: Paul Elder , laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl Subject: [PATCH v3 1/6] v4l2-compliance: Add version command Date: Sat, 11 Jul 2020 14:24:09 +0900 Message-Id: <20200711052414.492535-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 X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no 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 --- Changes in v3: - embed PACKAGE_VERSION instead of string concatenation --- 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 df46e86f..38d77d07 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"); +#endif + + printf(", %zd bits, %zd-bit time_t\n", sizeof(void *) * 8, sizeof(time_t) * 8); + printf("\n"); +} + +static void version() +{ + printf("v4l2-compliance %s\n", PACKAGE_VERSION); +} + 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"); -#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 Sat Jul 11 05:24:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 65386 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1ju9Rt-00ANpg-1q; Sat, 11 Jul 2020 06:57:25 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727785AbgGKFYb (ORCPT + 1 other); Sat, 11 Jul 2020 01:24:31 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:41174 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726786AbgGKFYb (ORCPT ); Sat, 11 Jul 2020 01:24: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 420B272C; Sat, 11 Jul 2020 07:24:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594445068; bh=FQOD3dys9oUJGL7BVMiDHKD6tDhGGpN2w1Aq1iBNmF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h5/w4tXaLAdwk+a3Rcp2IuRfdaVBWdLBXmfHmkETh2pmsRdYi56FmC22SUHRlmgDO qbQQx3vXG1Z5Q2LoAxAZKpqZDQ9BbQGj0MIp5vA44GeEX6+fMWsE4A588dOLS9Ct92 uPdHiL8MStj2lUyFLpsoec9GvMQz2SqLYwsZgg1k= From: Paul Elder To: linux-media@vger.kernel.org Cc: Paul Elder , laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl Subject: [PATCH v3 2/6] v4l2-ctl: Add version command Date: Sat, 11 Jul 2020 14:24:10 +0900 Message-Id: <20200711052414.492535-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200711052414.492535-1-paul.elder@ideasonboard.com> References: <20200711052414.492535-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 X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no Add a --version option to v4l2-ctl to retrieve the version of v4l2-ctl. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- Changes in v3: - embed PACKAGE_VERSION instead of string concatenation --- 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..ac66b814 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 %s\n", PACKAGE_VERSION); +} + 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 Sat Jul 11 05:24:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 65387 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1ju9Ru-00ANpg-2O; Sat, 11 Jul 2020 06:57:26 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727876AbgGKFYc (ORCPT + 1 other); Sat, 11 Jul 2020 01:24:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726786AbgGKFYc (ORCPT ); Sat, 11 Jul 2020 01:24:32 -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 DFF99C08C5DD for ; Fri, 10 Jul 2020 22:24:31 -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 CABB52FD; Sat, 11 Jul 2020 07:24:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594445070; bh=3ZCh1xSW4o7pRfP+LOW53UGu8Nsn0n3eddCwoJkU06A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m4DOgQJyIGbQ138QoTBScMvL2Zwmild5e6wArlOpA8z+Hc6zvLDZa/LgOG4kOYqUJ dBh/7oiucl1KO69ZEgBi2s8G8mbB+xkyoRejT7IThiX62aK0/hOcZ94lPaZe5mV5Hv yTD8SK1RqSA2leWDfAv6W1uW6ukfYkcz9bet8Jxw= From: Paul Elder To: linux-media@vger.kernel.org Cc: Paul Elder , laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl Subject: [PATCH v3 3/6] cec-compliance: Add version command Date: Sat, 11 Jul 2020 14:24:11 +0900 Message-Id: <20200711052414.492535-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200711052414.492535-1-paul.elder@ideasonboard.com> References: <20200711052414.492535-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 X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no 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 --- Changes in v3: - embed PACKAGE_VERSION instead of string concatenation --- 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..c0733d2e 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 %s\n", PACKAGE_VERSION); +} + 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 Sat Jul 11 05:24:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 65388 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1ju9Rv-00ANpg-3o; Sat, 11 Jul 2020 06:57:27 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727899AbgGKFYf (ORCPT + 1 other); Sat, 11 Jul 2020 01:24:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726786AbgGKFYe (ORCPT ); Sat, 11 Jul 2020 01:24:34 -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 7997CC08C5DD for ; Fri, 10 Jul 2020 22:24:34 -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 5F73A98D; Sat, 11 Jul 2020 07:24:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594445073; bh=e+VgNFc3j3J9a50psQCBgx3t8tXcmQ2WTllQCCzuN4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WL52tLDPjTABp+wMEa/a6pV4gmOKY6zBkU4GrnemCWacZbnNN7aqqeQMSBTD0wsbZ RQNLFapvaLBvHc3KRTVb1/x0DpPEWS3LJnRi8v4/Lw/U7DlluLeLNOkeEOAEwVQZYf OXmRUcBw6TTDeHUhvI0PyRlY1J5kklKCRiII7LjA= From: Paul Elder To: linux-media@vger.kernel.org Cc: Paul Elder , laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl Subject: [PATCH v3 4/6] cec-ctl: Add version command Date: Sat, 11 Jul 2020 14:24:12 +0900 Message-Id: <20200711052414.492535-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200711052414.492535-1-paul.elder@ideasonboard.com> References: <20200711052414.492535-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 X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no Add a --version option to cec-ctl to retrieve the version of cec-ctl. Signed-off-by: Paul Elder --- Changes in v3: - embed PACKAGE_VERSION instead of string concatenation --- 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..d0ea56ba 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 %s\n", PACKAGE_VERSION); +} + 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 Sat Jul 11 05:24:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 65389 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1ju9Rw-00ANpg-8b; Sat, 11 Jul 2020 06:57:28 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727939AbgGKFYh (ORCPT + 1 other); Sat, 11 Jul 2020 01:24:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726786AbgGKFYh (ORCPT ); Sat, 11 Jul 2020 01:24:37 -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 071AFC08C5DD for ; Fri, 10 Jul 2020 22:24:37 -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 E81D372C; Sat, 11 Jul 2020 07:24:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594445075; bh=RqL9nI6Na6108Vzbfv03n1BDZKu9y1UAubPBe8HazVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FilZvqRChvSAHdTLSkP9WGk7LaT+mNSfLIDf3xleozb/G8riaCeF6tOFS+7lN8wu/ HWLyIrI9RLoMb+6CysFHRarf2ilBCuMWNQc7p0bw1LbPyYtu1OOMSmMAJmxfpAiY11 uCXFAhy0n41KJ9b7N3/xYJsrcxLKwlJlXPzbXyKE= From: Paul Elder To: linux-media@vger.kernel.org Cc: Paul Elder , laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl Subject: [PATCH v3 5/6] cec-follower: Add version command Date: Sat, 11 Jul 2020 14:24:13 +0900 Message-Id: <20200711052414.492535-5-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200711052414.492535-1-paul.elder@ideasonboard.com> References: <20200711052414.492535-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 X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no Add a --version option to cec-follower to retrieve the version of cec-follower. Signed-off-by: Paul Elder --- Changes in v3: - embed PACKAGE_VERSION instead of string concatenation --- 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..a09e1550 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 %s\n", PACKAGE_VERSION); +} + 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 Sat Jul 11 05:24:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 65390 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1ju9Rx-00ANpg-Ap; Sat, 11 Jul 2020 06:57:29 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727951AbgGKFYk (ORCPT + 1 other); Sat, 11 Jul 2020 01:24:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726786AbgGKFYk (ORCPT ); Sat, 11 Jul 2020 01:24:40 -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 F329EC08C5DD for ; Fri, 10 Jul 2020 22:24:39 -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 7CB7398D; Sat, 11 Jul 2020 07:24:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594445078; bh=uHmb/iVMGnCR1f9AxnRfaO9wnJ5hyRW+BXqMG5SzcG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f7XA4t8RXrJGRMFXgmZ3VsnPaGeu2x1/oo4xAVJFUMIN0xnq4zlZQSfQejO6Vvf60 12wB6jj4d+5DoTcXalYb0XXVqRMoo3DcPk5MsJ9WbKyDZ8sfHDpRVKA1Kv+zDhnsdA NFEVsIamVGEYu7R3wrGWLZHdUMNtXQjt0+Xw9phc= From: Paul Elder To: linux-media@vger.kernel.org Cc: Paul Elder , laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl Subject: [PATCH v3 6/6] media-ctl: Add version command Date: Sat, 11 Jul 2020 14:24:14 +0900 Message-Id: <20200711052414.492535-6-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200711052414.492535-1-paul.elder@ideasonboard.com> References: <20200711052414.492535-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 X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no Add a --version option to media-ctl to retrieve the version of media-ctl. Signed-off-by: Paul Elder --- Changes in v3: - embed PACKAGE_VERSION instead of string concatenation --- 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..bc4f374f 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 %s\n", PACKAGE_VERSION); +} + 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;