# Path: invoke/tasks.py
# def task(*args, **kwargs):
#     """
#     Marks wrapped callable object as a valid Invoke task.
# 
#     May be called without any parentheses if no extra options need to be
#     specified. Otherwise, the following keyword arguments are allowed in the
#     parenthese'd form:
# 
#     * ``name``: Default name to use when binding to a `.Collection`. Useful for
#       avoiding Python namespace issues (i.e. when the desired CLI level name
#       can't or shouldn't be used as the Python level name.)
#     * ``aliases``: Specify one or more aliases for this task, allowing it to be
#       invoked as multiple different names. For example, a task named ``mytask``
#       with a simple ``@task`` wrapper may only be invoked as ``"mytask"``.
#       Changing the decorator to be ``@task(aliases=['myothertask'])`` allows
#       invocation as ``"mytask"`` *or* ``"myothertask"``.
#     * ``positional``: Iterable overriding the parser's automatic "args with no
#       default value are considered positional" behavior. If a list of arg
#       names, no args besides those named in this iterable will be considered
#       positional. (This means that an empty list will force all arguments to be
#       given as explicit flags.)
#     * ``optional``: Iterable of argument names, declaring those args to
#       have :ref:`optional values <optional-values>`. Such arguments may be
#       given as value-taking options (e.g. ``--my-arg=myvalue``, wherein the
#       task is given ``"myvalue"``) or as Boolean flags (``--my-arg``, resulting
#       in ``True``).
#     * ``iterable``: Iterable of argument names, declaring them to :ref:`build
#       iterable values <iterable-flag-values>`.
#     * ``incrementable``: Iterable of argument names, declaring them to
#       :ref:`increment their values <incrementable-flag-values>`.
#     * ``default``: Boolean option specifying whether this task should be its
#       collection's default task (i.e. called if the collection's own name is
#       given.)
#     * ``auto_shortflags``: Whether or not to automatically create short
#       flags from task options; defaults to True.
#     * ``help``: Dict mapping argument names to their help strings. Will be
#       displayed in ``--help`` output. For arguments containing underscores
#       (which are transformed into dashes on the CLI by default), either the
#       dashed or underscored version may be supplied here.
#     * ``pre``, ``post``: Lists of task objects to execute prior to, or after,
#       the wrapped task whenever it is executed.
#     * ``autoprint``: Boolean determining whether to automatically print this
#       task's return value to standard output when invoked directly via the CLI.
#       Defaults to False.
#     * ``klass``: Class to instantiate/return. Defaults to `.Task`.
# 
#     If any non-keyword arguments are given, they are taken as the value of the
#     ``pre`` kwarg for convenience's sake. (It is an error to give both
#     ``*args`` and ``pre`` at the same time.)
# 
#     .. versionadded:: 1.0
#     .. versionchanged:: 1.1
#         Added the ``klass`` keyword argument.
#     """
#     klass = kwargs.pop("klass", Task)
#     # @task -- no options were (probably) given.
#     if len(args) == 1 and callable(args[0]) and not isinstance(args[0], Task):
#         return klass(args[0], **kwargs)
#     # @task(pre, tasks, here)
#     if args:
#         if "pre" in kwargs:
#             raise TypeError(
#                 "May not give *args and 'pre' kwarg simultaneously!"
#             )
#         kwargs["pre"] = args
#     # @task(options)
#     # TODO: why the heck did we originally do this in this manner instead of
#     # simply delegating to Task?! Let's just remove all this sometime & see
#     # what, if anything, breaks.
#     name = kwargs.pop("name", None)
#     aliases = kwargs.pop("aliases", ())
#     positional = kwargs.pop("positional", None)
#     optional = tuple(kwargs.pop("optional", ()))
#     iterable = kwargs.pop("iterable", None)
#     incrementable = kwargs.pop("incrementable", None)
#     default = kwargs.pop("default", False)
#     auto_shortflags = kwargs.pop("auto_shortflags", True)
#     help = kwargs.pop("help", {})
#     pre = kwargs.pop("pre", [])
#     post = kwargs.pop("post", [])
#     autoprint = kwargs.pop("autoprint", False)
# 
#     def inner(obj):
#         obj = klass(
#             obj,
#             name=name,
#             aliases=aliases,
#             positional=positional,
#             optional=optional,
#             iterable=iterable,
#             incrementable=incrementable,
#             default=default,
#             auto_shortflags=auto_shortflags,
#             help=help,
#             pre=pre,
#             post=post,
#             autoprint=autoprint,
#             # Pass in any remaining kwargs as-is.
#             **kwargs
#         )
#         return obj
# 
#     return inner


from invoke.tasks import task
If we're being honest, though, the new 'tree' fixture package is a lot bigger.
"""



@task
def print_foo(c):
    print("foo")


@task
def print_name(c, name):
    print(name)


@task
def print_underscored_arg(c, my_option):
    print(my_option)


@task
def foo(c):
    print("foo")


@task(foo)
def bar(c):
    print("bar")



# Path: invoke/tasks.py
# def task(*args, **kwargs):
#     """
#     Marks wrapped callable object as a valid Invoke task.
# 
#     May be called without any parentheses if no extra options need to be
#     specified. Otherwise, the following keyword arguments are allowed in the
#     parenthese'd form:
# 
#     * ``name``: Default name to use when binding to a `.Collection`. Useful for
#       avoiding Python namespace issues (i.e. when the desired CLI level name
#       can't or shouldn't be used as the Python level name.)
#     * ``aliases``: Specify one or more aliases for this task, allowing it to be
#       invoked as multiple different names. For example, a task named ``mytask``
#       with a simple ``@task`` wrapper may only be invoked as ``"mytask"``.
#       Changing the decorator to be ``@task(aliases=['myothertask'])`` allows
#       invocation as ``"mytask"`` *or* ``"myothertask"``.
#     * ``positional``: Iterable overriding the parser's automatic "args with no
#       default value are considered positional" behavior. If a list of arg
#       names, no args besides those named in this iterable will be considered
#       positional. (This means that an empty list will force all arguments to be
#       given as explicit flags.)
#     * ``optional``: Iterable of argument names, declaring those args to
#       have :ref:`optional values <optional-values>`. Such arguments may be
#       given as value-taking options (e.g. ``--my-arg=myvalue``, wherein the
#       task is given ``"myvalue"``) or as Boolean flags (``--my-arg``, resulting
#       in ``True``).
#     * ``iterable``: Iterable of argument names, declaring them to :ref:`build
#       iterable values <iterable-flag-values>`.
#     * ``incrementable``: Iterable of argument names, declaring them to
#       :ref:`increment their values <incrementable-flag-values>`.
#     * ``default``: Boolean option specifying whether this task should be its
#       collection's default task (i.e. called if the collection's own name is
#       given.)
#     * ``auto_shortflags``: Whether or not to automatically create short
#       flags from task options; defaults to True.
#     * ``help``: Dict mapping argument names to their help strings. Will be
#       displayed in ``--help`` output. For arguments containing underscores
#       (which are transformed into dashes on the CLI by default), either the
#       dashed or underscored version may be supplied here.
#     * ``pre``, ``post``: Lists of task objects to execute prior to, or after,
#       the wrapped task whenever it is executed.
#     * ``autoprint``: Boolean determining whether to automatically print this
#       task's return value to standard output when invoked directly via the CLI.
#       Defaults to False.
#     * ``klass``: Class to instantiate/return. Defaults to `.Task`.
# 
#     If any non-keyword arguments are given, they are taken as the value of the
#     ``pre`` kwarg for convenience's sake. (It is an error to give both
#     ``*args`` and ``pre`` at the same time.)
# 
#     .. versionadded:: 1.0
#     .. versionchanged:: 1.1
#         Added the ``klass`` keyword argument.
#     """
#     klass = kwargs.pop("klass", Task)
#     # @task -- no options were (probably) given.
#     if len(args) == 1 and callable(args[0]) and not isinstance(args[0], Task):
#         return klass(args[0], **kwargs)
#     # @task(pre, tasks, here)
#     if args:
#         if "pre" in kwargs:
#             raise TypeError(
#                 "May not give *args and 'pre' kwarg simultaneously!"
#             )
#         kwargs["pre"] = args
#     # @task(options)
#     # TODO: why the heck did we originally do this in this manner instead of
#     # simply delegating to Task?! Let's just remove all this sometime & see
#     # what, if anything, breaks.
#     name = kwargs.pop("name", None)
#     aliases = kwargs.pop("aliases", ())
#     positional = kwargs.pop("positional", None)
#     optional = tuple(kwargs.pop("optional", ()))
#     iterable = kwargs.pop("iterable", None)
#     incrementable = kwargs.pop("incrementable", None)
#     default = kwargs.pop("default", False)
#     auto_shortflags = kwargs.pop("auto_shortflags", True)
#     help = kwargs.pop("help", {})
#     pre = kwargs.pop("pre", [])
#     post = kwargs.pop("post", [])
#     autoprint = kwargs.pop("autoprint", False)
# 
#     def inner(obj):
#         obj = klass(
#             obj,
#             name=name,
#             aliases=aliases,
#             positional=positional,
#             optional=optional,
#             iterable=iterable,
#             incrementable=incrementable,
#             default=default,
#             auto_shortflags=auto_shortflags,
#             help=help,
#             pre=pre,
#             post=post,
#             autoprint=autoprint,
#             # Pass in any remaining kwargs as-is.
#             **kwargs
#         )
#         return obj
# 
#     return inner


# Path: tests/_support/integration.py
from invoke.tasks import task

If we're being honest, though, the new 'tree' fixture package is a lot bigger.
"""



@task
def print_foo(c):
    print("foo")


@task
def print_name(c, name):
    print(name)


@task
def print_underscored_arg(c, my_option):
    print(my_option)


@task
def foo(c):
    print("foo")


@task(foo)
def bar(c):
    print("bar")



@task