Limit accepted values for --format argument (#2938)

It used to accept any arbitrary string

Close https://github.com/zalando/patroni/issues/2936
This commit is contained in:
Alexander Kukushkin
2023-11-03 13:02:39 +01:00
committed by GitHub
parent d72f7cb259
commit 8adddb3467
+2 -1
View File
@@ -255,7 +255,8 @@ def load_config(path: str, dcs_url: Optional[str]) -> Dict[str, Any]:
return config
option_format = click.option('--format', '-f', 'fmt', help='Output format (pretty, tsv, json, yaml)', default='pretty')
option_format = click.option('--format', '-f', 'fmt', help='Output format', default='pretty',
type=click.Choice(['pretty', 'tsv', 'json', 'yaml', 'yml']))
option_watchrefresh = click.option('-w', '--watch', type=float, help='Auto update the screen every X seconds')
option_watch = click.option('-W', is_flag=True, help='Auto update the screen every 2 seconds')
option_force = click.option('--force', is_flag=True, help='Do not ask for confirmation at any point')