completedefaultIt is called to complete the input of a string after you enter a command for which the method is not available complete_<commandname>.
Try the following:
import cmd
class T(cmd.Cmd):
def completedefault(self, *a):
print 'completedefault called'
return []
def test(self, *args):
print "test args: ", args
t=T()
t.cmdloop()
now enter test[space] and click the tab completedefaultshould be done now.
, completenames , completedefault.