cli: adapt for click 8.3.0
click 8.3.0 changes behavior of default/flag_value parameters in a backward incompatible way which results in --list being default even though it's not intended.
Change code to work the same way in click < 8.3.0 and >= 8.3.0.
The horrors of Python ecosystem are never-ending.