mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
27 lines
539 B
Ruby
27 lines
539 B
Ruby
class IMICFPS
|
|
class Commands
|
|
class HelpCommand < Command
|
|
def group
|
|
:global
|
|
end
|
|
|
|
def command
|
|
:help
|
|
end
|
|
|
|
def handle(arguments, console)
|
|
console.stdin(usage(arguments.first))
|
|
end
|
|
|
|
def usage(command = nil)
|
|
if command
|
|
if cmd = Command.find(command)
|
|
cmd.usage
|
|
end
|
|
else
|
|
"Available commands:\n#{Command.list_commands.map { |cmd| "#{Style.highlight(cmd.command)}" }.join(', ')}"
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end |