summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2022-11-07 16:49:13 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-08 17:24:23 +0000
commitfdc477a9858fd7880d0988d82953833a9ddc2713 (patch)
treee35bfcefbdb8e8da33f8d11a1cbfc118398182bf
parentc4502710f6872bac0c5c46261035c428b976e7e9 (diff)
downloadchrome-ec-release-R109-15237.B-cr50_stab.tar.gz
The getopt_long() library function returns '?' (decimal 63) in case there is a command line parameter with required value, but there is no value in the command line. gsctool is printing "could not find long opt table index for 63" in this case, which is misleading. This patch changes error message to make sense. BUG=none TEST=before this change running './gsctool -D -R' results in "could not find long opt table index for 63" after this change error message is "Command line error, parameter argument missing" Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: I5b1a8fda62a7edd673ea1181efb73108677b77d1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4010704 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
-rw-r--r--extra/usb_updater/gsctool.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c
index 8826b13917..24efaeb747 100644
--- a/extra/usb_updater/gsctool.c
+++ b/extra/usb_updater/gsctool.c
@@ -3436,8 +3436,7 @@ static int get_longindex(int short_opt, const struct option *long_opts)
* We could never come here as the short options list is compiled
* based on long options table.
*/
- fprintf(stderr, "could not find long opt table index for %d\n",
- short_opt);
+ fprintf(stderr, "Command line error, parameter argument missing\n");
exit(1);
return -1; /* Not reached. */