mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 23:52:35 +00:00
Added DebugCommand, added support for 'subcommands'
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
class IMICFPS
|
||||
class Commands
|
||||
class HelpCommand < Command
|
||||
def initialize
|
||||
end
|
||||
|
||||
def group
|
||||
:global
|
||||
end
|
||||
@@ -13,11 +10,17 @@ class IMICFPS
|
||||
end
|
||||
|
||||
def handle(arguments, console)
|
||||
console.stdin(usage)
|
||||
console.stdin(usage(arguments.first))
|
||||
end
|
||||
|
||||
def usage
|
||||
"HELP\ncommand [arguments]\ncommand subcommand [argument]"
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user