1
0
mirror of https://github.com/mnaberez/py65.git synced 2025-01-04 01:30:18 +00:00

Show help for fill when no arguments are given

This commit is contained in:
Mike Naberezny 2012-02-06 10:13:27 -08:00
parent 2da902cf7b
commit 496ace9db0
2 changed files with 20 additions and 4 deletions

View File

@ -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:])

View File

@ -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 <address_range>'))
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 <address_range>'))
def test_help_fill(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.help_fill()
out = stdout.getvalue()
self.assertTrue(out.startswith('fill <address_range>'))
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 <address_range>'))
# goto