X-Git-Url: https://mudpy.org/gitweb?a=blobdiff_plain;f=mudpy%2Fcommand.py;h=5ba3d28582471d095242581a6c20c2a4863310cf;hb=f38d6c0f396d2ff3da597b0fbac2cee2891df934;hp=1138aa85370545c848e06bb7de5992fec495a13f;hpb=641a045ea5407a56626c7ea718efc7bbf5152ba1;p=mudpy.git diff --git a/mudpy/command.py b/mudpy/command.py index 1138aa8..5ba3d28 100644 --- a/mudpy/command.py +++ b/mudpy/command.py @@ -11,7 +11,7 @@ import unicodedata import mudpy -def chat(actor): +def chat(actor, parameters): """Toggle chat mode.""" mode = actor.get("mode") if not mode: @@ -148,10 +148,7 @@ def help(actor, parameters): if parameters and actor.owner: # is the command word one for which we have data? - if parameters in actor.universe.groups["command"]: - command = actor.universe.groups["command"][parameters] - else: - command = None + command = mudpy.misc.find_command(parameters) # only for allowed commands if actor.can_run(command): @@ -164,7 +161,8 @@ def help(actor, parameters): output = "$(red)" else: output = "$(grn)" - output += parameters + "$(nrm) - " + description + "$(eol)$(eol)" + output = "%s%s$(nrm) - %s$(eol)$(eol)" % ( + output, command.subkey, description) # add the help text if provided help_text = command.get("help") @@ -273,14 +271,14 @@ def preferences(actor, parameters): actor.send(message) -def quit(actor): +def quit(actor, parameters): """Leave the world and go back to the main menu.""" if actor.owner: actor.owner.state = "main_utility" actor.owner.deactivate_avatar() -def reload(actor): +def reload(actor, parameters): """Reload all code modules, configs and data.""" if actor.owner: @@ -425,9 +423,8 @@ def show(actor, parameters): elif arguments[0] == "version": message = repr(actor.universe.versions) elif arguments[0] == "time": - message = actor.universe.groups["internal"]["counters"].get( - "elapsed" - ) + " increments elapsed since the world was created." + message = "%s increments elapsed since the world was created." % ( + str(actor.universe.groups["internal"]["counters"].get("elapsed"))) elif arguments[0] == "groups": message = "These are the element groups:$(eol)" groups = list(actor.universe.groups.keys())