summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2019-08-07 12:02:41 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-08-13 13:04:40 -0700
commit0a783a5ea6f0355026341bc27131cae8bfb63c5d (patch)
tree76df4c35cc91d3c2482bc25498bff740a94781f4
parentbcadefc89b159dd9bc70c1e1cd651c4ea03924d6 (diff)
downloadchrome-ec-0a783a5ea6f0355026341bc27131cae8bfb63c5d.tar.gz
gsctool: make options mutually exclusive
Fix the mutually exclusive check, so using 2 raises an error. Also fix the error message to show -U instead of -u. Upstart isn't exclusive. CCD unlock is. BUG=none BRANCH=none TEST=gsctool -i -U raises an error. Change-Id: Iaf43f18fefc1a8c4b6612b05daa5c82a7680b310 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1742220 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r--extra/usb_updater/gsctool.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c
index e7c9d5cef2..f462749bb8 100644
--- a/extra/usb_updater/gsctool.c
+++ b/extra/usb_updater/gsctool.c
@@ -2748,12 +2748,13 @@ int main(int argc, char *argv[])
printf("Ignoring binary image %s\n", argv[optind]);
}
+
if (((bid_action != bid_none) + !!rma + !!password + !!ccd_open +
!!ccd_unlock + !!ccd_lock + !!ccd_info + !!get_flog +
- !!openbox_desc_file + !!factory_mode + !!wp) > 2) {
+ !!openbox_desc_file + !!factory_mode + !!wp) > 1) {
fprintf(stderr,
"ERROR: "
- "options -F, -I, -i, -k, -L, -O, -o, -P, -r, -u and -w "
+ "options -F, -I, -i, -k, -L, -O, -o, -P, -r, -U and -w "
"are mutually exclusive\n");
exit(update_error);
}