package me.makskay.bukkit.tidy.commands;

import me.makskay.bukkit.tidy.IssueManager;
import me.makskay.bukkit.tidy.TidyPlugin;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

public class IssueCommand implements CommandExecutor {
	private IssueManager issueManager;
	
	public IssueCommand(TidyPlugin plugin) {
		issueManager = plugin.getIssueManager();
	}
	
	public boolean onCommand (CommandSender sender, Command command, String commandLabel, String[] args) {
		return false; // TODO Fill out with actual command implementation
	}
}

@@ -113,20 +113,92 @@
 idy.
-TidyPlugin;%0A
+IssueReport;%0Aimport me.makskay.bukkit.tidy.TidyPlugin;%0A%0Aimport org.bukkit.ChatColor;
 %0Aimp
@@ -607,73 +607,680 @@
 %7B%0A%09%09
-return false; // TODO Fill out with actual command implementation
+if (args.length != 1) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09%0A%09%09int uid;%0A%09%09try %7B%0A%09%09%09uid = Integer.parseInt(args%5B0%5D);%0A%09%09%7D catch (NumberFormatException ex) %7B%0A%09%09%09sender.sendMessage(ChatColor.RED + %22%5C%22%22 +  args%5B0%5D + %22%5C%22 isn't a valid issue ID number%22);%0A%09%09%09return true;%0A%09%09%7D%0A%09%09%0A%09%09IssueReport issue = issueManager.getIssue(uid);%0A%09%09if (issue == null) %7B%0A%09%09%09sender.sendMessage(ChatColor.RED + %22Couldn't find issue #%22 + uid);%0A%09%09%09return true;%0A%09%09%7D%0A%09%09%0A%09%09if (!issue.canBeEditedBy(sender)) %7B%0A%09%09%09sender.sendMessage(ChatColor.RED + %22You're not permitted to view details of that issue%22);%0A%09%09%09return true;%0A%09%09%7D%0A%09%09%0A%09%09for (String line : issue.fullSummary()) %7B%0A%09%09%09sender.sendMessage(line);%0A%09%09%7D%0A%09%09%0A%09%09return true;
 %0A%09%7D%0A

Implement IssueCommand