After adding a command to Cmd.multilineCommands, only the full name of the command accepts multiple lines. Abbreviations of the command still work, but only accept a single line.
Example:
import sys
from cmd2 import Cmd
class MLApp(Cmd):
Cmd.multilineCommands.append('foobar')
def do_foobar(self, line):
print('foobar')
def do_wassup(self, line):
print('wassup')
def main():
app = MLApp()
app.cmdloop()
if __name__ == '__main__':
main()
The output:
pi@raspi:~ $ python3 ~/ml_abbrev.py
(Cmd) was
wassup
(Cmd) wassup
wassup
(Cmd) foo
foobar
(Cmd) foobar
> one
> two
> ;
foobar
(Cmd)
After adding a command to Cmd.multilineCommands, only the full name of the command accepts multiple lines. Abbreviations of the command still work, but only accept a single line.
Example:
The output: