Furquan Shaikh c42cf911ad util/cbfstool: Allow use of non-ASCII longopt
CB:29744 ("util/cbfstool: Add optional argument ibb") added support
for non-ASCII characters for long_options. However, there is a check
later on which errors out since this character is not one of the
commands[i].optstring.

This change adds a function valid_opt() which does the following
things:
1. Checks if the returned optchar is among the list of optstring
supported by the command.
2. Checks if the returned optchar is a valid non-ASCII
option. Currently, we do not maintain a list of non-ASCII options
supported by each command. So, this function returns true if the
optchar returned by getopt_long falls within the allowed range.

Signed-off-by: Furquan Shaikh <furquan@google.com>
Change-Id: I27a4f9af9850e4c892573202904fa9e5fbb64df6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40375
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2020-04-20 06:08:29 +00:00
..
2020-01-30 13:47:49 +00:00
2020-03-02 15:03:03 +00:00
2020-01-30 13:01:00 +00:00
2020-01-30 13:01:00 +00:00
2020-01-28 06:36:13 +00:00
2019-11-20 10:10:48 +00:00
2018-08-28 14:20:15 +00:00
2018-08-28 14:20:15 +00:00
2020-01-28 06:36:13 +00:00
2020-01-30 13:47:49 +00:00
2020-01-30 13:01:00 +00:00
2018-08-28 14:20:15 +00:00
2013-02-04 11:12:15 +01:00
2018-06-15 09:13:24 +00:00
2020-01-30 13:01:00 +00:00
2019-06-24 09:45:00 +00:00
2020-01-30 13:01:00 +00:00
2018-08-28 14:20:15 +00:00
2020-03-23 08:34:23 +00:00
2020-03-23 08:34:23 +00:00
2020-01-30 13:01:00 +00:00