[Ml-yokadi] Using '_' as a shortcut to last task id

Aurélien Gâteau aurelien.gateau at free.fr
Thu Sep 17 09:26:09 CEST 2009


Sébastien Renard a écrit :
> Le samedi 12 septembre 2009 12:49:02, Sébastien Renard a écrit :
>> Le mardi 1 septembre 2009 16:45:20, Aurélien Gâteau a écrit :
>>> Hi,
>>>
>>> Please find attached patches implementing '_' as a shortcut to last task
>>> id. This means you can do:
>>>
>>>   yokadi> t_add home Buy chocolate
>>>   Added task 'Buy chocolate' (id=1069)
>>>
>>>   yokadi> t_edit _
>>>
>>> To edit last task.
>>>
>>> It should work in all task-related commands (please report if you find a
>>> missing command). I choose '_' because Python interpreter use the same
>>> symbol for the same purpose.
>>>
>>> What do you think about this?
>> Looks like perl ;-).
>>
>> Seriously, it is a good feature. Please push it.
> 
> Well, after reading your patch I have a concern about the global variable 
> lastTaskId. As this information is tightly related to shell context, why don't 
> simply add it as a YokadiCmd member ?

If I do this, then how would dbutils.getTaskFromId() reach it? I am
afraid moving it would mean changing every task command to explicitly
pass the lastTaskId.

Aurélie


More information about the Ml-yokadi mailing list