From c12e5bb4f3eb217e711c739d9b828e4a2a1a0a5d Mon Sep 17 00:00:00 2001 From: Daniel Danis Date: Mon, 3 Apr 2023 12:04:51 -0400 Subject: [PATCH 1/2] Cli does not interpret positional parameters as varargs when using `--require` and `--organ-system` options. Signed-off-by: Daniel Danis --- .../main/java/org/phenopackets/phenopackettools/cli/Main.java | 1 + .../phenopackettools/cli/command/ValidateCommand.java | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/Main.java b/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/Main.java index 087d03c1..06153b99 100644 --- a/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/Main.java +++ b/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/Main.java @@ -48,6 +48,7 @@ public static void main(String[] args) { Locale.setDefault(Locale.US); //noinspection InstantiationOfUtilityClass CommandLine cline = new CommandLine(new Main()) + .setUnmatchedOptionsArePositionalParams(false) .setColorScheme(COLOR_SCHEME); cline.getSubcommands().get("generate-completion").getCommandSpec().usageMessage().hidden(true); System.exit(cline.execute(args)); diff --git a/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/command/ValidateCommand.java b/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/command/ValidateCommand.java index 9ef0ee7b..4dd8b3b0 100644 --- a/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/command/ValidateCommand.java +++ b/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/command/ValidateCommand.java @@ -49,7 +49,6 @@ public static class ValidateSection { public boolean includeHeader = false; @CommandLine.Option(names = {"--require"}, - arity = "*", description = "Path to JSON schema with additional requirements to enforce.") public List requirements = List.of(); @@ -58,7 +57,6 @@ public static class ValidateSection { public Path hpJson; @CommandLine.Option(names = {"-s", "--organ-system"}, - arity = "*", description = {"Organ system HPO term IDs", "Default: empty"}) public List organSystems = List.of(); From 04a754fcf1dc021eeba18a3eeb0a130d7f3da70d Mon Sep 17 00:00:00 2001 From: Daniel Danis Date: Mon, 3 Apr 2023 12:05:04 -0400 Subject: [PATCH 2/2] Increase logging verbosity. Signed-off-by: Daniel Danis --- .../phenopackettools/cli/command/ConvertCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/command/ConvertCommand.java b/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/command/ConvertCommand.java index a4b578ec..b1abb6e7 100644 --- a/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/command/ConvertCommand.java +++ b/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/command/ConvertCommand.java @@ -62,7 +62,9 @@ protected Integer execute() { // (2) Convert into v2 format. if (convertSection.convertVariants) - LOGGER.debug("Converting variants"); + LOGGER.info("Converting variants"); + else + LOGGER.info("Ignoring variants since the `--convert-variants` option is unset"); V1ToV2Converter converter = V1ToV2Converter.of(convertSection.convertVariants); List converted = new ArrayList<>(messages.size());