gen_compile_commands: use choices for --log_levels option
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 22 Aug 2020 14:56:10 +0000 (23:56 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 26 Aug 2020 15:44:33 +0000 (00:44 +0900)
commitea6cedc5b8a4e666da41f1173ea19970fa60683f
tree9ebf8342cb3cb2777c42f59b99210d9afb80147b
parent8a685db32f2b3495c91efab6e9462c2fd934778f
gen_compile_commands: use choices for --log_levels option

Use 'choices' to check if the given parameter is valid.

I also simplified the help message because, with 'choices', --help
shows the list of valid parameters:

  --log_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}

I started the help message with a lower case, "the level of log ..."
in order to be consistent with the -h option:

  -h, --help            show this help message and exit

The message "show this help ..." comes from the ArgumentParser library
code, and I do not know how to change it. So, I changed our code.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
scripts/gen_compile_commands.py