Skip to content

Commit 796631a

Browse files
committed
Allowing coordinates (T/S and blocks) to be specified as hex.
1 parent e213bf4 commit 796631a

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

app/cli-acx/src/main/java/io/github/applecommander/acx/arggroup/CoordinateSelection.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.webcodepro.applecommander.storage.Disk;
2323
import com.webcodepro.applecommander.storage.physical.ImageOrder;
2424

25+
import io.github.applecommander.acx.converter.IntegerTypeConverter;
2526
import picocli.CommandLine.ArgGroup;
2627
import picocli.CommandLine.Option;
2728

@@ -62,9 +63,11 @@ else if (blockCoordinate != null) {
6263
}
6364

6465
public static class SectorCoordinateSelection {
65-
@Option(names = { "-t", "--track" }, required = true, description = "Track number.")
66+
@Option(names = { "-t", "--track" }, required = true, description = "Track number.",
67+
converter = IntegerTypeConverter.class)
6668
private Integer track;
67-
@Option(names = { "-s", "--sector" }, required = true, description = "Sector number.")
69+
@Option(names = { "-s", "--sector" }, required = true, description = "Sector number.",
70+
converter = IntegerTypeConverter.class)
6871
private Integer sector;
6972

7073
public boolean isBootSector() {
@@ -97,7 +100,7 @@ public void write(Disk disk, byte[] data) {
97100
}
98101
}
99102
public static class BlockCoordinateSelection {
100-
@Option(names = { "-b", "--block" }, description = "Block number.")
103+
@Option(names = { "-b", "--block" }, description = "Block number.", converter = IntegerTypeConverter.class)
101104
private Integer block;
102105

103106
public boolean isBootBlock() {

0 commit comments

Comments
 (0)