view examples/util/Cat.java @ 1:5df24c91468d

Oh my what a mess.
author samer
date Fri, 05 Apr 2019 16:26:00 +0100
parents bf79fb79ee13
children
line wrap: on
line source
package eg.util;
import  samer.core.*;
import  java.io.*;

public class Cat
{
	public static void main( String args[]) 
	{ 
		// set up message window
		new samer.core.shells.AppShell();

		BufferedReader d = new BufferedReader(new InputStreamReader(System.in));
                
		try { 
			String s;
			for (;;) {
				s=d.readLine();
				if (s==null) break; 
				Shell.print(s); 
			}
		} catch (IOException e) { Shell.print("---- error ----");}

		String term="\n---------------------------\nclose window to exit";
		if (args.length==0) { Shell.print(term); }
		else {
			if (!args[0].equals("-q")) Shell.print(term);
			else { Shell.exit(); }
		}
	}
}