Mercurial > hg > jslab
comparison examples/util/Cat.java @ 0:bf79fb79ee13
Initial Mercurial check in.
author | samer |
---|---|
date | Tue, 17 Jan 2012 17:50:20 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:bf79fb79ee13 |
---|---|
1 package eg.util; | |
2 import samer.core.*; | |
3 import java.io.*; | |
4 | |
5 public class Cat | |
6 { | |
7 public static void main( String args[]) | |
8 { | |
9 // set up message window | |
10 new samer.core.shells.AppShell(); | |
11 | |
12 BufferedReader d = new BufferedReader(new InputStreamReader(System.in)); | |
13 | |
14 try { | |
15 String s; | |
16 for (;;) { | |
17 s=d.readLine(); | |
18 if (s==null) break; | |
19 Shell.print(s); | |
20 } | |
21 } catch (IOException e) { Shell.print("---- error ----");} | |
22 | |
23 String term="\n---------------------------\nclose window to exit"; | |
24 if (args.length==0) { Shell.print(term); } | |
25 else { | |
26 if (!args[0].equals("-q")) Shell.print(term); | |
27 else { Shell.exit(); } | |
28 } | |
29 } | |
30 } | |
31 |