From c4b4aa2c79dc801311af6483079e6cb6a84d0919 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Wed, 28 Oct 2020 15:20:04 -0400 Subject: [PATCH] slog_common_event: Allow --help and --version even on unsupported platforms Signed-off-by: Stephen Gallagher --- src/slog_common_event.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/slog_common_event.c b/src/slog_common_event.c index a034511635a993330154578632b0824cbacddf18..970551cc9cf953e08a09309e655056f41152b50e 100644 --- a/src/slog_common_event.c +++ b/src/slog_common_event.c @@ -77,20 +77,10 @@ main(int argc, char **argv) { char *e=NULL, *s=NULL, *d=NULL, *l=NULL; char desc[1024]; servicelog *slog; struct sl_event event; uint64_t event_id; - int platform = 0; - - platform = get_platform(); - switch (platform) { - case PLATFORM_UNKNOWN: - case PLATFORM_POWERNV: - fprintf(stderr, "%s is not supported on the %s platform\n", - argv[0], __power_platform_name(platform)); - exit(1); - } for (;;) { option_index = 0; rc = getopt_long(argc, argv, "e:t:s:d:l:hvV", long_options, &option_index); @@ -135,10 +125,21 @@ main(int argc, char **argv) { "(%s).\n", PACKAGE_BUGREPORT); exit(1); } } + int platform = 0; + + platform = get_platform(); + switch (platform) { + case PLATFORM_UNKNOWN: + case PLATFORM_POWERNV: + fprintf(stderr, "%s is not supported on the %s platform\n", + argv[0], __power_platform_name(platform)); + exit(1); + } + if (e == NULL) { if (verbose) { fprintf(stderr, "The --event command-line argument is " "required."); } -- 2.28.0