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])
