Changeset 2689


Ignore:
Timestamp:
04/26/07 16:54:31 (13 years ago)
Author:
curtis
Message:

Add debugging flag to bfconvert.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/FormatTools.java

    r2687 r2689  
    591591    throws FormatException, IOException 
    592592  { 
     593    String in = null, out = null; 
     594    if (args != null) { 
     595      for (int i=0; i<args.length; i++) { 
     596        if (args[i].startsWith("-") && args.length > 1) { 
     597          if (args[i].equals("-debug")) FormatHandler.setDebug(true); 
     598          else System.out.println("Ignoring unknown command flag: " + args[i]); 
     599        } 
     600        else { 
     601          if (in == null) in = args[i]; 
     602          else if (out == null) out = args[i]; 
     603          else System.out.println("Ignoring unknown argument: " + args[i]); 
     604        } 
     605      } 
     606    } 
     607    if (FormatHandler.debug) { 
     608      System.out.println("Debugging at level " + FormatHandler.debugLevel); 
     609    } 
    593610    String className = writer.getClass().getName(); 
    594     if (args == null || args.length < 2) { 
     611    if (in == null || out == null) { 
    595612      System.out.println("To convert a file to " + writer.getFormat() + 
    596613        " format, run:"); 
    597       System.out.println("  java " + className + " in_file out_file"); 
     614      System.out.println("  java " + className + " [-debug] in_file out_file"); 
    598615      return false; 
    599616    } 
    600     String in = args[0]; 
    601     String out = args[1]; 
    602617 
    603618    ImageReader reader = new ImageReader(); 
Note: See TracChangeset for help on using the changeset viewer.