Commit 46848545 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

[zlib-bench] Let a leading '-' be enough to indicate options

Look for one '-' instead of two '--', to process program options. Some
users have old habits like typing -? for help, for example.

Bug: 798943
Change-Id: I6d757b161ffb2082c8ad0a96e41a31f479969a30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2160955Reviewed-by: default avatarLeon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#761958}
parent 723c1509
......@@ -325,7 +325,7 @@ int main(int argc, char* argv[]) {
else
usage_exit(argv[0]);
while (argn < argc && !strncmp(argv[argn], "--", 2)) {
while (argn < argc && argv[argn][0] == '-') {
if (get_option(argc, argv, "--compression")) {
if (!get_compression(argc, argv, &zlib_compression_level))
usage_exit(argv[0]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment