mirror of
https://github.com/mnaberez/py65.git
synced 2025-01-04 01:30:18 +00:00
Show help when add_label is given incorrect args
This commit is contained in:
parent
02ff83d18b
commit
41883160f8
@ -627,7 +627,7 @@ class Monitor(cmd.Cmd):
|
||||
split = shlex.split(args)
|
||||
if len(split) != 2:
|
||||
self._output("Syntax error: %s" % args)
|
||||
return
|
||||
return self.help_add_label()
|
||||
|
||||
address = self._address_parser.number(split[0])
|
||||
label = split[1]
|
||||
|
@ -55,7 +55,8 @@ class MonitorTests(unittest.TestCase):
|
||||
mon = Monitor(stdout=stdout)
|
||||
mon.do_add_label('should be label space value')
|
||||
out = stdout.getvalue()
|
||||
self.assertEqual("Syntax error: should be label space value\n", out)
|
||||
err = "Syntax error: should be label space value\n"
|
||||
self.assertTrue(out.startswith(err))
|
||||
|
||||
def test_do_add_label_adds_label(self):
|
||||
stdout = StringIO()
|
||||
|
Loading…
Reference in New Issue
Block a user