Changeset 4733


Ignore:
Timestamp:
01/06/09 16:59:29 (11 years ago)
Author:
curtis
Message:

More robust parsing of command line flags.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/tools/TiffComment.java

    r4732 r4733  
    4242      return; 
    4343    } 
     44 
     45    // parse flags 
    4446    boolean edit = false; 
    4547    for (int i=0; i<args.length; i++) { 
    46       if (args[i].equals("-edit")) { 
    47         edit = true; 
    48         continue; 
    49       } 
     48      if (!args[i].startsWith("-")) continue; 
    5049 
    51       if (edit) { 
    52         EditTiffG.openFile(args[i]); 
    53       } 
     50      if (args[i].equals("-edit")) edit = true; 
     51      else System.out.println("Warning: unknown flag: " + args[i]); 
     52    } 
     53 
     54    // process files 
     55    for (int i=0; i<args.length; i++) { 
     56      if (args[i].startsWith("-")) continue; 
     57 
     58      if (edit) EditTiffG.openFile(args[i]); 
    5459      else { 
    5560        String comment = TiffTools.getComment(args[i]); 
Note: See TracChangeset for help on using the changeset viewer.