In the past we had empty output when one said invoke by itself (IIRC), then #165 happened and now it will pick up a default root task; but if there IS no default root task we just get a ValueError. It should probably do something useful like print core help or a task list.
A workaround until then is to add a task like this to your tasks file. However, the list task shows up in the task list. It would be nice if you could hide it some how.
@epicserve I am curious though why you were even running invoke by itself :) it's not something I see users do super duper often (same with fab). It's important to have it behave "well" but at the same time I'm not sure why folks need a workaround exactly ;)
shrug I'm different/special I guess. :) I run commands all the time without arguments (ls, mkdir, pwd, workon, stree, ifconfig, pep8, ipython, pyflakes, setvirtualenvproject, virtualenvwrapper, etc).
I think it would be nice to display at least a minimal usage/help string...
Usage: inv[oke] [--core-opts] task1 [--task1-opts] ... taskN [--taskN-opts]
For more information: invoke --help
To list available invokations: invoke --list
No default task set.
If there isn't a tasks.py, there should probably be a better error than:
Can't find any collection named None!
Probably a message like: (after the Usage strings)
Could not find a tasks.py file. Either run with -f or create a task file.
None of this is vital of course, but it's nice polish :)
I thought it did get updated to print a more useful "no collection found" msg? If not there's probably another ticket for it...
It does print a more useful message with no tasks.py -- I was looking at an old virtualenv.
I'm new to Invoke and really like it so far. One of the biggest surprises has been the default behavior of showing a traceback when running just invoke, and I was even more surprised when I noticed that docs say it should be same as invoke --help:
In other words, +1 from me to show help unless configured otherwise. Luckily I can easily emulate that behavior:
"""Show help, basically an alias for --help.
Needed as a default task due to https://github.com/pyinvoke/invoke/issues/180
Good catch re: the docs. I retain the right to change things at whim given it's pre 1.0, but clearly past-me thought help output was the sane default; and that's also Unix tradition much of the time, so yea. Let's do that.
Failing test re: empty invoke w/ no default task
Refactor help output & implement fix re #180
Changelog re #180, fixes #180