public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] igt_core: Add --version
@ 2020-04-06 13:15 Petri Latvala
  2020-04-06 13:18 ` Arkadiusz Hiler
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Petri Latvala @ 2020-04-06 13:15 UTC (permalink / raw)
  To: igt-dev; +Cc: Tomi Sarvela, Petri Latvala

To help verify correct deployment, add a --version flag that just
prints the IGT-Version text.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 lib/igt_core.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 77862498..3f7b9f68 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -320,6 +320,7 @@ enum {
 	OPT_SKIP_CRC,
 	OPT_TRACE_OOPS,
 	OPT_DEVICE,
+	OPT_VERSION,
 	OPT_HELP = 'h'
 };
 
@@ -685,6 +686,7 @@ static void print_usage(const char *help_str, bool output_on_stderr)
 		   "  --help-description\n"
 		   "  --describe\n"
 		   "  --device filter\n"
+		   "  --version\n"
 		   "  --help|-h\n");
 	if (help_str)
 		fprintf(f, "%s\n", help_str);
@@ -859,6 +861,7 @@ static int common_init(int *argc, char **argv,
 		{"skip-crc-compare",  no_argument,       NULL, OPT_SKIP_CRC},
 		{"trace-on-oops",     no_argument,       NULL, OPT_TRACE_OOPS},
 		{"device",            required_argument, NULL, OPT_DEVICE},
+		{"version",           no_argument,       NULL, OPT_VERSION},
 		{"help",              no_argument,       NULL, OPT_HELP},
 		{0, 0, 0, 0}
 	};
@@ -998,6 +1001,10 @@ static int common_init(int *argc, char **argv,
 			}
 			igt_device_filter_set(optarg);
 			break;
+		case OPT_VERSION:
+			print_version();
+			ret = -1;
+			goto out;
 		case OPT_HELP:
 			print_usage(help_str, false);
 			ret = -1;
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-06 23:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-06 13:15 [igt-dev] [PATCH i-g-t] igt_core: Add --version Petri Latvala
2020-04-06 13:18 ` Arkadiusz Hiler
2020-04-06 16:52 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-04-06 23:00 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox