Initial Commit
This commit is contained in:
18
Scripts/Gameplay/CommandLine/Commands/help.gd
Normal file
18
Scripts/Gameplay/CommandLine/Commands/help.gd
Normal file
@@ -0,0 +1,18 @@
|
||||
extends Resource
|
||||
var desc: String = "Show commands"
|
||||
var usage: String = "help"
|
||||
|
||||
func main(args: Array, context: cCommandLine) -> void:
|
||||
if context.commands.size() == 0:
|
||||
context._print("No commands available.")
|
||||
return
|
||||
|
||||
context._print("Available Commands:")
|
||||
for name in context.commands.keys():
|
||||
var cmd_script = context.commands[name]
|
||||
var cmd_instance = cmd_script.new()
|
||||
|
||||
var cmdDescription = cmd_instance.desc
|
||||
var cmdUsage = "Usage: " + cmd_instance.usage
|
||||
|
||||
context._print("%s: %s\n%s" % [name, cmdDescription, cmdUsage])
|
||||
Reference in New Issue
Block a user