From 00866f423e80e6c2316619d955e3bbda3d343e09 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 10 Oct 2006 08:20:59 +0000 Subject: [PATCH] Fix listCommands. --- src/sst.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/sst.py b/src/sst.py index 635816e..79c8e62 100644 --- a/src/sst.py +++ b/src/sst.py @@ -6064,12 +6064,14 @@ commands = { def listCommands(): "Generate a list of legal commands." - proutn(_("LEGAL COMMANDS ARE:")) - for (k, key) in enumerate(commands): + prout(_("LEGAL COMMANDS ARE:")) + emitted = 0 + for key in commands: if not commands[key] or (commands[key] & game.options): - if k % 5 == 0: + proutn("%-12s " % key) + emitted += 1 + if emitted % 5 == 4: skip(1) - proutn("%-12s " % key) skip(1) def helpme(): -- 2.31.1