summaryrefslogtreecommitdiff
path: root/src/jed.java
blob: 7c14070617b5e60159d19af04e880d0c482ba73e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package jed;

import java.util.Scanner;

public class jed {

    public static Scanner kbIn = new Scanner(System.in);
    public static filebuffer file;

    public static void main(String args[]) {
        String fileName = null;
        boolean hasName = true;
        try { // checks if the user provided a file name
            fileName = args[0];
        } catch (IndexOutOfBoundsException e) {
            hasName = false;
        }

        file = new filebuffer(fileName, hasName);

        while (true) {
            String line = kbIn.nextLine();
            int err = cmd.parser(line);
            if (err == 1)
                break;
        }
        kbIn.close();
    }
}