Merge pull request #2752 from greyli/patch-9

Check whether there are registered routes
This commit is contained in:
David Lord 2018-05-02 06:16:11 -07:00 committed by GitHub
commit ad09134c8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -825,6 +825,10 @@ def routes_command(sort, all_methods):
"""Show all registered routes with endpoints and methods."""
rules = list(current_app.url_map.iter_rules())
if not rules:
click.echo('No routes were registered.')
return
ignored_methods = set(() if all_methods else ('HEAD', 'OPTIONS'))
if sort in ('endpoint', 'rule'):