Changeset 2585


Ignore:
Timestamp:
04/09/07 15:14:04 (13 years ago)
Author:
melissa
Message:

Better parsing of command-line arguments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/ome/notebook/Notebook.java

    r2583 r2585  
    609609 
    610610  public static void main(String[] args) { 
    611     Notebook n = new Notebook(args.length > 0 ? args[0] : null, 
    612       args.length > 1 ? args[1] : null); 
     611    String template = null, data = null; 
     612    for (int i=0; i<args.length; i++) { 
     613      if (args[i].equals("-template")) { 
     614        if (args.length > i + 1) {  
     615          template = args[i++]; 
     616        } 
     617        else System.err.println("Please specify a template file"); 
     618      } 
     619      else data = args[i];  
     620    } 
     621    
     622    new Notebook(template, data); 
    613623  } 
    614624 
Note: See TracChangeset for help on using the changeset viewer.