_paver()
{
cmds=`paver -q list_tasks`
COMPREPLY=( $(compgen -W '$cmds' -- $cur))
}
complete -F _paver paver
This bash script assumes that the pavement file being used is the
default one ie pavement.py and that file has a task called
'list_tasks' which lists all the task. If 'list_tasks' task could be
merged into paver package itself, that would be really useful.
Now whenever I am in my python project directory with a pavement.py
which has the necessary 'list_tasks' method, I have auto-complete with
paver!
My two pence.
--
You received this message because you are subscribed to the Google Groups "paver" group.
To post to this group, send email to pa...@googlegroups.com.
To unsubscribe from this group, send email to paver+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/paver?hl=en.
@task
def list_tasks():
task_list = environment.get_tasks()
for task in task_list:
print task.shortname
I copied this bit of code from a method called 'help' in paver/
tasks.py.
Note that my script suppresses all other auto completion. So its
definitely just an idea right now.
cheers
> > paver+un...@googlegroups.com <paver%2Bunsu...@googlegroups.com>.
_paver()
{
cmds=$( paver -hq | awk '/\s*([a-zA-Z][a-zA-Z0-9_]+)/
{print $1}' )
COMPREPLY=( $(compgen -W '$cmds' -- "$cur") )
}
complete -F _paver paver