I am building command-line utility, using python cmd module. Now I want change the default *** Unknown syntax: ds something like this [-] Unknown command: ds.
Is it possible to change that?
I am building command-line utility, using python cmd module. Now I want change the default *** Unknown syntax: ds something like this [-] Unknown command: ds.
Is it possible to change that?
Yes, you simply need to override the default() method:
class MyCmd(cmd.Cmd):
def default(self, line):
self.stdout.write('[-] Unknown command: %s\n' % (line,))