def cli_plugin(func=None, **kwargs):
<EOL>if func is None:<EOL><INDENT>return functools.partial(cli_plugin, **kwargs)<EOL><DEDENT>if not isinstance(func, CLIPluginFuncWrapper):<EOL><INDENT>func = CLIPluginFuncWrapper(do_run=func, init_args=kwargs)<EOL><DEDENT>else:<EOL><INDENT>func.set_init_args(kwargs)<EOL><DEDENT>return func<EOL>
Decorator that wraps the given function in a :class:`CLIPlugin`

Args:
    func (callable): function/class to decorate
    **kwargs: Any other arg to use when initializing the parser (like help,
        or prefix_chars)

Returns:
    CLIPlugin: cli plugin that handles that method

Notes:
    It can be used as a decorator or as a decorator generator, if used as a
    decorator generator don't pass any parameters

Examples:
    >>> @cli_plugin
    ... def test(**kwargs):
    ...     print 'test'
    ...
    >>> print test.__class__
    <class 'cli.CLIPluginFuncWrapper'>

    >>> @cli_plugin()
    ... def test(**kwargs):
    ...     print 'test'
    >>> print test.__class__
    <class 'cli.CLIPluginFuncWrapper'>

    >>> @cli_plugin(help='dummy help')
    ... def test(**kwargs):
    ...     print 'test'
    >>> print test.__class__
    <class 'cli.CLIPluginFuncWrapper'>
    >>> print test.init_args['help']
    'dummy help'