Adding integer type conversion supporting hex prefixes "$" and "0x" as

well as decimal.
This commit is contained in:
Rob Greene 2022-12-28 10:58:53 -06:00
parent 46a2455922
commit 8ce99c4efa

View File

@ -21,6 +21,7 @@ package io.github.applecommander.acx.arggroup;
import com.webcodepro.applecommander.storage.Disk; import com.webcodepro.applecommander.storage.Disk;
import io.github.applecommander.acx.converter.IntegerTypeConverter;
import picocli.CommandLine.ArgGroup; import picocli.CommandLine.ArgGroup;
import picocli.CommandLine.Option; import picocli.CommandLine.Option;
@ -61,9 +62,11 @@ public class CoordinateSelection {
} }
public static class SectorCoordinateSelection { public static class SectorCoordinateSelection {
@Option(names = { "-t", "--track" }, required = true, description = "Track number.") @Option(names = { "-t", "--track" }, required = true, converter = IntegerTypeConverter.class,
description = "Track number.")
private Integer track; private Integer track;
@Option(names = { "-s", "--sector" }, required = true, description = "Sector number.") @Option(names = { "-s", "--sector" }, required = true, converter = IntegerTypeConverter.class,
description = "Sector number.")
private Integer sector; private Integer sector;
public boolean isBootSector() { public boolean isBootSector() {
@ -77,7 +80,8 @@ public class CoordinateSelection {
} }
} }
public static class BlockCoordinateSelection { public static class BlockCoordinateSelection {
@Option(names = { "-b", "--block" }, description = "Block number.") @Option(names = { "-b", "--block" }, converter = IntegerTypeConverter.class,
description = "Block number.")
private Integer block; private Integer block;
public boolean isBootBlock() { public boolean isBootBlock() {