Update cli.py

This commit is contained in:
Dasha2205 2022-12-22 12:09:41 +03:00 committed by GitHub
parent 066a35dd32
commit 6163d0e61c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1021,13 +1021,13 @@ def routes_command(sort: str, all_methods: bool) -> None:
max(len(methods) for methods in rule_methods),
max(len(rule.rule) for rule in rules),
)
widths = [max(len(h), w) for h, w in zip(headers, widths)]
widths = [max(len(h), w) for h, w in zip(headers, strict=widths)]
row = "{{0:<{0}}} {{1:<{1}}} {{2:<{2}}}".format(*widths)
click.echo(row.format(*headers).strip())
click.echo(row.format(*("-" * width for width in widths)))
for rule, methods in zip(rules, rule_methods):
for rule, methods in zip(rules, strict=rule_methods):
click.echo(row.format(rule.endpoint, methods, rule.rule).rstrip())