Skip to content
Myr

Added a group decorator to group classes.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 0868754 · Browse files · 1 file+13 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+13 added−1 removed

  • other:+13 added−1 removed

1 file+13 added−1 removed

modified:click/core.py+13 added-1 removed
570 unmodified lines
571 self.add_command(cmd)572 return cmd573 return decorator574575 def group(self, *args, **kwargs):576 """A shortcut decorator for declaring and attaching a group to577 the group. This takes the same arguments as :func:`group` but578 immediately registers the created command with this instance by579 calling into :meth:`add_command`.580 """581 def decorator(f):582 cmd = group(*args, **kwargs)(f)583 self.add_command(cmd)584 return cmd585 return decorator586587 def get_command(self, ctx, cmd_name):588 return self.commands.get(cmd_name)589590 def list_commands(self, ctx):
441 unmodified lines
1032 return value, args103310341035# Circular dependency between decorators and core1024from .decorators import command, help_option1036from .decorators import command, group, help_option