aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/com/jantuomi/tunkki/Main.java
blob: 098f0ffa7015ab41ad0ee5dd29e7fd8e2eb0d69b (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
package com.jantuomi.tunkki;

import com.jantuomi.tunkki.core.CommandLineArgumentContainer;

public class Main {

    private static Tunkki tunkki;

    public static void main(String[] args) throws Exception {
        tunkki = new Tunkki();

        boolean parseSuccess = tunkki.parseArguments(args);
        if (!parseSuccess) {
            return;
        }

        if (CommandLineArgumentContainer.getInstance().isInteractive()) {
            tunkki.repl();
        } else {
            String sourceFileContents = CommandLineArgumentContainer.getInstance().getSourceFileContents();
            tunkki.run(sourceFileContents);
        }
    }

}