Skip to content

Abbreviations of multiline commands do not accept multiple lines #102

@brainbarker

Description

@brainbarker

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions