mirror of
https://github.com/mnaberez/py65.git
synced 2025-01-01 11:29:32 +00:00
Show help if `goto
` is issued without an address
This commit is contained in:
parent
0d35c2d351
commit
d2ef9582b0
@ -429,6 +429,9 @@ class Monitor(cmd.Cmd):
|
||||
self._output("Change the PC to address and continue execution.")
|
||||
|
||||
def do_goto(self, args):
|
||||
if args == '':
|
||||
return self.help_goto()
|
||||
|
||||
self._mpu.pc = self._address_parser.number(args)
|
||||
brks = [0x00] # BRK
|
||||
self._run(stopcodes=brks)
|
||||
|
@ -417,6 +417,13 @@ class MonitorTests(unittest.TestCase):
|
||||
out = stdout.getvalue()
|
||||
self.assertTrue(out.startswith('goto'))
|
||||
|
||||
def test_goto_without_args_shows_command_help(self):
|
||||
stdout = StringIO()
|
||||
mon = Monitor(stdout=stdout)
|
||||
mon.onecmd('goto')
|
||||
out = stdout.getvalue()
|
||||
self.assertTrue("goto <address>" in out)
|
||||
|
||||
# help
|
||||
|
||||
def test_help_without_args_shows_documented_commands(self):
|
||||
|
Loading…
Reference in New Issue
Block a user