From 283d6f98df1b56f0093a550524e542447632cb70 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Wed, 8 Jul 2015 17:00:43 +0200 Subject: [PATCH] doubleclick: Push ctx for subcommands --- vdirsyncer/doubleclick.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vdirsyncer/doubleclick.py b/vdirsyncer/doubleclick.py index 47567cf..e58d946 100644 --- a/vdirsyncer/doubleclick.py +++ b/vdirsyncer/doubleclick.py @@ -87,6 +87,14 @@ ctx = _StackProxy(_ctx_stack) def _ctx_pushing_class(cls): class ContextPusher(cls): + def command(self, *args, **kwargs): + # Also wrap commands created with @group.command() + def decorator(f): + cmd = click.command(*args, **kwargs)(f) + self.add_command(cmd) + return cmd + return decorator + def invoke(self, ctx): _ctx_stack.push(ctx) try: