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..506dac3ba1d 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; @@ -55,7 +56,7 @@ public static void main(String[] args) throws FormatException, IOException { if (args.length == 0) { System.out.println("Usage:"); System.out.println( - "tiffcomment [-set comment] [-edit] file1 [file2 ...]"); + "tiffcomment [-version] [-debug] [-trace] [-no-upgrade] [-set comment] [-edit] file1 [file2 ...]"); System.out.println(); System.out.println("This tool requires an ImageDescription tag to be " + @@ -70,11 +71,15 @@ public static void main(String[] args) throws FormatException, IOException { System.out.println(" * '-', to enter the comment using stdin. " + "Entering a blank line will"); System.out.println(" terminate reading from stdin."); + System.out.println(); + System.out.println("Additional options:"); + System.out.println(" -version: print the library version and exit"); + System.out.println(" -no-upgrade: do not perform the upgrade check"); + System.out.println(" -debug: enable DEBUG-level logging"); + System.out.println(" -trace: enable TRACE-level logging"); return; } - CommandLineTools.runUpgradeCheck(args); - // parse flags boolean edit = false; String newComment = null; @@ -106,9 +111,23 @@ else if (newComment.equals("-")) { } } } - else System.out.println("Warning: unknown flag: " + args[i]); + else if (args[i].equals(CommandLineTools.VERSION)) { + CommandLineTools.printVersion(); + return; + } + 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) {