pyinvoke/invoke — pull request #197 by tyewang (2014-12-08 05:45:11+00:00)
Title: Allow subcollections to be defaults of parent collections

Hi,

I thought it would be a nice for subcollections to be defaults of their parent collection. Given that running a task and running the default task of a subcollection is basically the same (i.e. `invoke foo`), it makes sense that subcollections can be defaults if tasks can be defaults.

For example, if I have a collection named "tests" with a default task of "run_unit_tests", I might want the default of the top level namespace to be the default of "tests". With this PR, we can do:

```
tests_collection = Collection('tests')
tests_collection.add_task(Task(run_unit_tests), default=True)

namespace = Collection()
namespace.add_collection(tests_collection, default=True)
```

That way, I can simply type `invoke` and run my unit tests.