forked from orbit-oss/flask
Add Blueprint level cli command registration
Implements #1357. Adds ability to register click cli commands onto blueprint.
This commit is contained in:
parent
855d59b68b
commit
ec1ccd7530
6 changed files with 136 additions and 8 deletions
10
flask/app.py
10
flask/app.py
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue