diff --git a/src/py65/monitor.py b/src/py65/monitor.py index 80966aa..8007301 100644 --- a/src/py65/monitor.py +++ b/src/py65/monitor.py @@ -566,8 +566,7 @@ class Monitor(cmd.Cmd): def do_fill(self, args): split = shlex.split(args) if len(split) < 2: - self._output("Syntax error: %s" % args) - return + return self.help_fill() start, end = self._address_parser.range(split[0]) filler = map(self._address_parser.number, split[1:]) diff --git a/src/py65/tests/test_monitor.py b/src/py65/tests/test_monitor.py index 110fcf1..f8ec3dd 100644 --- a/src/py65/tests/test_monitor.py +++ b/src/py65/tests/test_monitor.py @@ -291,7 +291,7 @@ class MonitorTests(unittest.TestCase): mon.do_help('f') out = stdout.getvalue() - self.assertTrue(out.startswith('fill')) + self.assertTrue(out.startswith('fill ')) def test_shortcut_gt_for_fill(self): stdout = StringIO() @@ -299,7 +299,24 @@ class MonitorTests(unittest.TestCase): mon.do_help('>') out = stdout.getvalue() - self.assertTrue(out.startswith('fill')) + self.assertTrue(out.startswith('fill ')) + + def test_help_fill(self): + stdout = StringIO() + mon = Monitor(stdout=stdout) + mon.help_fill() + + out = stdout.getvalue() + self.assertTrue(out.startswith('fill ')) + + def test_do_fill_with_no_args_shows_help(self): + stdout = StringIO() + mon = Monitor(stdout=stdout) + mon.do_fill('') + + out = stdout.getvalue() + self.assertTrue(out.startswith('fill ')) + # goto