package com.dmgame.net.script;

import com.dmgame.net.script.*;
import com.dmgame.net.server.*;

return new Verbose();

class Verbose extends ServerCommand{

	String VERBOSE_ACCEPT = "- verbose set to: "

	String getName(){return "verbose"};

	boolean perform(Scanner s){
		if(!s.hasNext()){
			println("- true|false required")
			return false
		}
		String flag = s.next().toLowerCase()
		if("true".contains(flag)){
			ServerUtility.verbose = true
			println(VERBOSE_ACCEPT + "true")
		}
		else if("false".contains(flag)){
			ServerUtility.verbose = false
			println(VERBOSE_ACCEPT + "false")
		}
		else if("help".contains(flag)){
			println("- sets the detail level of output. Accepted values are true|false")
			return false
		}
		else{
			println("- Unkown flag. Accepted input: true|false")
			return false
		}
		return true
	}
}