1.7 Comamnd Line Options: Processing

<..process command line..>
 boolean help=false;
 for( int n=0; n<args.length; n++ ){
   <.get args[n].>
 }
 <.default stdio output.>
 <.help message and stop on improper args in batch mode.>
 new FileInfo(logWriter, i_scriptDir, trace);
 if( inFile != null ){
    inputObject = new InputObject( inFile, logWriter );
    if( inputObject.getInputStream() == null ){
       instructionErr( null, "Could not find or open file: " + inFile, 28 );
    }
    inFile = inputObject.getFilename();
 } else {
    inputObject = new InputObject( inData.getBytes("UTF-8"), logWriter );
 }
 inputObject.buildProfile( trace );
 -_-_-

<..help message and stop on improper args in batch mode..>
 if( !returnDom ){
    if( help || ((inFile == null) && (inData == null)) ){
      <.display command line syntax.>
      if( (inFile == null) && (inData == null) ){
         System.exit(0);
 }  } }
 -_-_-

<..improper args[n]..>
 if( !exceptionErrs ){
   for(int i=n+1; i<args.length; i++ ){
     if( args[i].equals("-E") ){ exceptionErrs = true; }
 } }
 instructionErr( null,
      "Improper argument: " + args[n] + "\n" + xtpipes_call, 26 );
 -_-_-

<..scan input data..>
 n++;
 if( n < args.length ){
    inData = args[n];
 } else {
    System.err.println(
        "--- Error --- Missing field for -d argument" );
    inFile = null; inData = null; break;
 }
 -_-_-

<..xtpipes fields..>+
 private static String     inFile,
                           inData;
 private static boolean exceptionErrs, messages;
 public static InputObject inputObject;
 -_-_-

<..init fields..>+
 inFile = null;
 inData = null;
 exceptionErrs = false;
 messages = false;
 -_-_-