Skip to content
Success

Changes

Summary

  1. pySim-shell: obey quit command in startup commands+scripts (details)
Commit c4a6b8b3e794dce6dd6b79b9fdbc76d93a48c122 by pmaier@sysmocom.de
pySim-shell: obey quit command in startup commands+scripts

Startup scripts are executed using the cmd2 provided onecmd_plus_hooks
method. This method can run arbitrary commands, which also includes
the command "run_scrit" that we use to execute startup scripts.

When a script executes a quit command, or when someone issues a quit
command using the --execute-command or the command argument, then
this commands is executed. However a quit command won't actually quit
the process. All it does is to change the return code of
app.onecmd_plus_hooks (see [1]). So we must evaluate the return code
and take care of the quitting ourselves.

[1] https://cmd2.readthedocs.io/en/0.9.15/api/cmd.html#cmd2.cmd2.Cmd.onecmd_plus_hooks

Related: OS#6731
Change-Id: Ic6e9c54cdb6955d65011af3eb5a025eee5da4143
The file was modifiedpySim-shell.py