modifyPartition(PARTITION.getValue(cmdLine), api, bs);
modifyPartition(PARTITION.getValue(cmdLine), api, bs, current);
	public static void main(String[] args) throws SyntaxErrorException {		ParsedArguments cmdLine = HELP_INFO.parse(args);		DeviceManager dm;		try {			dm = InitialNaming.lookup(DeviceManager.NAME);			boolean isAction = PARAM_ACTION.isSet(cmdLine);			boolean isInitMBR = PARAM_INITMBR.isSet(cmdLine);			boolean isDevice = PARAM_DEVICE.isSet(cmdLine);			// no parameters			if (!isDevice) {				listAvailableDevice(dm);				return;			}			// only device is set			if (!isAction && !isInitMBR && isDevice) {				printTable(ARG_DEVICE.getValue(cmdLine), dm);				return;			}			// initMBR			if (isInitMBR) {				initMbr(ARG_DEVICE.getValue(cmdLine), dm);				return;			}			// now it is a change on a specific partition so read the table			IDEDevice current = (IDEDevice)dm.getDevice(ARG_DEVICE.getValue(cmdLine));			BlockDeviceAPI api = current.getAPI(BlockDeviceAPI.class);			ByteBuffer mbr = ByteBuffer.allocate(IDEConstants.SECTOR_SIZE);			api.read(0, mbr);			if (!IBMPartitionTable.containsPartitionTable(mbr.array()))				throw new IOException("This device doesn't contain a valid MBR, use --initmbr.");			BootSector bs = new BootSector(mbr.array());			if (ACTION.getValue(cmdLine).intern() == "-m") {				modifyPartition(PARTITION.getValue(cmdLine), api, bs);				bs.write(api);				return;			}			// it is not a modify so the PARTITION parameter is only a partition			// number			int partNumber;			try {				partNumber = Integer.parseInt(PARTITION.getValue(cmdLine));			} catch (NumberFormatException f) {				throw new IllegalArgumentException("Partition number is invalid");			}			if (partNumber > 3 || partNumber < 0)				throw new IllegalArgumentException("Partition number is invalid");			if (ACTION.getValue(cmdLine).intern() == "-d") {				deletePartition(bs, partNumber);				bs.write(api);				return;			}			if (ACTION.getValue(cmdLine).intern() == "-b") {				toggleBootable(bs, partNumber);				bs.write(api);			}		} catch (IOException e) {			e.printStackTrace();		} catch (NameNotFoundException e) {			e.printStackTrace();		} catch (ApiNotFoundException e) {			e.printStackTrace();		} catch (DeviceNotFoundException e) {			e.printStackTrace();		} 	}