public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {

		if(sender instanceof Player) {
			player = (Player) sender;
		}
		
		if(cmd.getName().equalsIgnoreCase("delquery")) {
			if(player==null) {
				
				//debugging
				Query.debugMsg("Console used the /delquery command. Argument 1: " + args[0]);
				
			} else {
				
				//debugging
				Query.debugMsg(ChatColor.DARK_PURPLE + player.getName() + " used the /delquery command. Argument 1: " + args[0]);
				
				File[] list = getFiles();
				
				//debugging
				Query.debugMsg("Files in " + plugin.getDataFolder() + "/Queries: " + list.toString());
				
				boolean match = false;
				
				if(checkPerm("delquery")) {
					Query.debugMsg("Has permission.");
					if(list.length != 0) {
						for(File f : list) {
							
							Query.debugMsg("Iterating through " + f.getName());
							
							if(isYaml(f)) {
								
								String noExt = getFilesNoExt().get(f);
								
								if(args[0].equalsIgnoreCase(noExt)) {
									
						    		//debugging
							    	Query.debugMsg("File match found for delete argument.");
							    	
						    		//Sets that a match was found
						    		match = true;
						    		
						    		/*
						    		 * Actually deletes the file of the specified query
						    		 * This comes after the message because if it was deleted,
						    		 * Java wouldn't be able to get the name of the file
						    		 * anymore because the file WOULDN'T EXIST!
						    		 */
						    		
						    		f.delete();

						    		//Tells the player that the file was deleted.
						    		player.sendMessage(ChatColor.DARK_PURPLE + "Query " + noExt + " was sucessfully deleted.");
						    		
						    		Query.promptMsg("Query " + noExt + " was sucessfully deleted by " + player.getName());
						    		
						    		//Break the loop because the query was found and deleted.
						    		break;
						    	}
							}
						}
					}
				}
				if(!match) {
					player.sendMessage(ChatColor.DARK_RED + "Query " + args[0] + " was not found.");
				}
			}
			return true;
		}
		return false;	
	}