public InternalCommand[] listCommands() {
		int numInvisible = 0;
		for (String cmd : commands.keySet())
			if (!commands.get(cmd).visible)
				numInvisible++;
		InternalCommand[] list = new InternalCommand[commands.size() - numInvisible];
		int i = 0;
		for (String cmd : commands.keySet()) {
			if (commands.get(cmd).visible) {
				list[i] = commands.get(cmd);
				i += 1;
			}
		}
		Arrays.sort(list, new CommandComp());
		return list;
	}