From f33369f89747ed27d2f7e95de6b533fd39c63302 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Tue, 10 Dec 2024 15:05:50 -0600 Subject: [PATCH] tiffcomment: fix `-version`, `-no-upgrade`, `-debug`, `-trace` --- .../src/loci/formats/tools/TiffComment.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/components/bio-formats-tools/src/loci/formats/tools/TiffComment.java b/components/bio-formats-tools/src/loci/formats/tools/TiffComment.java index 45d5aadcc6f..a22a5a48659 100644 --- a/components/bio-formats-tools/src/loci/formats/tools/TiffComment.java +++ b/components/bio-formats-tools/src/loci/formats/tools/TiffComment.java @@ -40,6 +40,7 @@ import loci.common.Constants; import loci.common.DataTools; +import loci.common.DebugTools; import loci.common.RandomAccessInputStream; import loci.common.RandomAccessOutputStream; import loci.formats.FormatException; @@ -73,8 +74,6 @@ public static void main(String[] args) throws FormatException, IOException { return; } - CommandLineTools.runUpgradeCheck(args); - // parse flags boolean edit = false; String newComment = null; @@ -106,9 +105,22 @@ else if (newComment.equals("-")) { } } } - else System.out.println("Warning: unknown flag: " + args[i]); + else if (args[i].equals(CommandLineTools.VERSION)) { + CommandLineTools.printVersion(); + } + else if (args[i].equals("-debug")) { + DebugTools.setRootLevel("DEBUG"); + } + else if (args[i].equals("-trace")) { + DebugTools.setRootLevel("TRACE"); + } + else if (!args[i].equals(CommandLineTools.NO_UPGRADE_CHECK)) { + System.out.println("Warning: unknown flag: " + args[i]); + } } + CommandLineTools.runUpgradeCheck(args); + // process files for (String file : files) { if (edit) {