Changeset 3130


Ignore:
Timestamp:
08/31/07 15:25:19 (13 years ago)
Author:
curtis
Message:

Add -version command line flag.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/ome/OmeisImporter.java

    r3108 r3130  
    8080 
    8181  // -- OmeisImporter API methods - main functionality -- 
     82 
     83  /** Prints out the build date for the Bio-Formats OMEIS utility. */ 
     84  public void printVersion() { 
     85    if (http) printHttpResponseHeader(); 
     86    System.out.println("Bio-Formats OMEIS importer, built on @date@."); 
     87  } 
    8288 
    8389  /** 
     
    576582  public static void main(String[] args) { 
    577583    OmeisImporter importer = new OmeisImporter(); 
    578     boolean test = false; 
     584    boolean version = false, test = false; 
    579585    int[] fileIds = new int[args.length]; 
    580586 
     
    582588    int num = 0; 
    583589    for (int i=0; i<args.length; i++) { 
    584       if ("-test".equalsIgnoreCase(args[i])) test = true; 
     590      if ("-version".equalsIgnoreCase(args[i])) version = true; 
     591      else if ("-test".equalsIgnoreCase(args[i])) test = true; 
    585592      else if ("-http-response".equalsIgnoreCase(args[i])) http = true; 
    586593      else { 
     
    600607    // process the IDs 
    601608    try { 
    602       if (test) importer.testIds(fileIds); 
     609      if (version) importer.printVersion(); 
     610      else if (test) importer.testIds(fileIds); 
    603611      else importer.importIds(fileIds); 
    604612    } 
    605     catch (Exception exc) { 
     613    catch (Throwable t) { 
    606614      // NB: We really do want to catch all exception types here, 
    607615      // to redirect output properly for the OME server. 
     
    609617        importer.printHttpErrorHeader(); 
    610618        System.out.println("An exception occurred while processing FileIDs:"); 
    611         exc.printStackTrace(System.out); 
     619        t.printStackTrace(System.out); 
    612620      } 
    613621      System.err.println("An exception occurred:"); 
    614       exc.printStackTrace(); 
     622      t.printStackTrace(); 
    615623      System.exit(1); 
    616624    } 
Note: See TracChangeset for help on using the changeset viewer.