vm: provide writer in PrintOps()
Make it more flexible and testable. Fallback to using stdout if no writer is provided.
This commit is contained in:
parent
9a4183abb9
commit
2f39701d76
4 changed files with 10 additions and 6 deletions
|
@ -429,7 +429,9 @@ func handleOps(c *ishell.Context) {
|
|||
return
|
||||
}
|
||||
v := getVMFromContext(c)
|
||||
v.PrintOps()
|
||||
out := bytes.NewBuffer(nil)
|
||||
v.PrintOps(out)
|
||||
c.Println(out.String())
|
||||
}
|
||||
|
||||
func changePrompt(c ishell.Actions, v *vm.VM) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue