Add Blueprint level cli command registration

Implements #1357.
Adds ability to register click cli commands onto blueprint.
This commit is contained in:
Anthony Plunkett 2018-05-14 22:05:54 -04:00 committed by David Lord
parent 855d59b68b
commit ec1ccd7530
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
6 changed files with 136 additions and 8 deletions

View file

@ -600,13 +600,9 @@ class Flask(_PackageBoundObject):
view_func=self.send_static_file,
)
#: The click command line context for this application. Commands
#: registered here show up in the :command:`flask` command once the
#: application has been discovered. The default commands are
#: provided by Flask itself and can be overridden.
#:
#: This is an instance of a :class:`click.Group` object.
self.cli = cli.AppGroup(self.name)
# Set the name of the Click group in case someone wants to add
# the app's commands to another CLI tool.
self.cli.name = self.name
@locked_cached_property
def name(self):