mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 23:52:35 +00:00
Added support for Console auto-complete
This commit is contained in:
@@ -10,6 +10,11 @@ class IMICFPS
|
||||
end
|
||||
|
||||
def handle(arguments, console)
|
||||
if arguments.size > 1
|
||||
console.stdin("to many arguments for #{Style.highlight("#{command}")}, got #{Style.error(arguments.size)} expected #{Style.notice(1)}.")
|
||||
return
|
||||
end
|
||||
|
||||
case arguments.last
|
||||
when "", nil
|
||||
console.stdin("#{Style.highlight("fps")}: #{$debug.get(:fps)}")
|
||||
|
||||
@@ -17,6 +17,8 @@ class IMICFPS
|
||||
if command
|
||||
if cmd = Command.find(command)
|
||||
cmd.usage
|
||||
else
|
||||
"#{Style.error(command)} is not a command"
|
||||
end
|
||||
else
|
||||
"Available commands:\n#{Command.list_commands.map { |cmd| "#{Style.highlight(cmd.command)}" }.join(', ')}"
|
||||
|
||||
Reference in New Issue
Block a user