znmud-0.0.1/benchmark/
znmud-0.0.1/cmd/
znmud-0.0.1/cmd/emotes/
znmud-0.0.1/cmd/objects/
znmud-0.0.1/cmd/tiny/
znmud-0.0.1/doc/
znmud-0.0.1/farts/
znmud-0.0.1/lib/
znmud-0.0.1/lib/combat/
znmud-0.0.1/lib/core/bodytypes/
znmud-0.0.1/lib/engine/
znmud-0.0.1/lib/farts/
znmud-0.0.1/logs/
#
# file::    cmd_wizhelp.rb

# This source code copyright (C) 2009 Craig Smith
# All rights reserved.
#
# Released under the terms of the TeensyMUD Public License
# See LICENSE file for additional information.
#

module Cmd

  bindtextdomain("cmd")

  # The wizhelp command for builder/wizard help system
  def cmd_wizhelp(args)
    case args
    when nil, ""
      sendto _("================WIZ HELP=======================")
      line = String.new
      wordcnt = 0
      world.cmds.to_hash.values.each do |h|
	case h.perm
	when "builder"
		if world.can_build? id
			line += sprintf("%-15s", h.name)
			wordcnt+=1
		end
	when "admin"
		if world.is_admin? id
			line += sprintf("%-15s", h.name)
			wordcnt+=1
		end
	end
	if wordcnt == 3
		sendto(line)
		line = ""
		wordcnt = 0
	end
      end
      sendto(line) if line
    else
      q = world.cmds.find(args)
      if q
        sendto _("================WIZ HELP=======================")
        q.each do |h|
          sendto(sprintf("%-10s - %s", h.name, h.help))
        end
      else
        sendto _("No help on that.")
      end
    end
  end

end