From 8ce99c4efa8866c529a7910bbf0ffe8a4a22f587 Mon Sep 17 00:00:00 2001 From: Rob Greene Date: Wed, 28 Dec 2022 10:58:53 -0600 Subject: [PATCH] Adding integer type conversion supporting hex prefixes "$" and "0x" as well as decimal. --- .../acx/arggroup/CoordinateSelection.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/cli-acx/src/main/java/io/github/applecommander/acx/arggroup/CoordinateSelection.java b/app/cli-acx/src/main/java/io/github/applecommander/acx/arggroup/CoordinateSelection.java index 552f713..497a9dc 100644 --- a/app/cli-acx/src/main/java/io/github/applecommander/acx/arggroup/CoordinateSelection.java +++ b/app/cli-acx/src/main/java/io/github/applecommander/acx/arggroup/CoordinateSelection.java @@ -21,6 +21,7 @@ package io.github.applecommander.acx.arggroup; import com.webcodepro.applecommander.storage.Disk; +import io.github.applecommander.acx.converter.IntegerTypeConverter; import picocli.CommandLine.ArgGroup; import picocli.CommandLine.Option; @@ -61,9 +62,11 @@ public class CoordinateSelection { } 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; - @Option(names = { "-s", "--sector" }, required = true, description = "Sector number.") + @Option(names = { "-s", "--sector" }, required = true, converter = IntegerTypeConverter.class, + description = "Sector number.") private Integer sector; public boolean isBootSector() { @@ -77,7 +80,8 @@ public class CoordinateSelection { } } public static class BlockCoordinateSelection { - @Option(names = { "-b", "--block" }, description = "Block number.") + @Option(names = { "-b", "--block" }, converter = IntegerTypeConverter.class, + description = "Block number.") private Integer block; public boolean isBootBlock() {