def METHOD_NAME(name, **kw):
    callback_ = kw.pop("callback", None)
    if callback_:
        class CallableAction(argparse.Action):
            def __call__(self, parser, namespace,
                         values, option_string=None):
                callback_(option_string, values, parser)
        kw["action"] = CallableAction
    group.addoption(name, **kw)