In general, all cmd2 commands are scriptable within a Python script via "cmd('command args')". However, since when running within a Python script we are actually within the do_py command, quit doesn't actually quit the cmd2 application.
The current behavior is non-intuitive. Issuing a cmd('quit') should really quit.
Add code like the following to do_quit() and do_py():
def do_quit(self):
self._should_quit = True
def do_py(self):
...
return self._should_quit
In general, all cmd2 commands are scriptable within a Python script via "cmd('command args')". However, since when running within a Python script we are actually within the do_py command, quit doesn't actually quit the cmd2 application.
The current behavior is non-intuitive. Issuing a cmd('quit') should really quit.
Add code like the following to do_quit() and do_py():