12
11
import pipe.gui.CreateGui;
13
12
import dk.aau.cs.debug.Logger;
16
14
public class TAPAAL {
19
17
* Main class for lunching TAPAAL
20
19
* @author Kenneth Yrke Joergensen (kenneth@yrke.dk)
22
21
public static void main(String[] args) {
24
22
// Create a CommandLineParser using Posix Style
25
23
CommandLineParser parser = new PosixParser();
27
25
// Create possible commandline options
28
26
Options options = new Options();
29
options.addOption( "d", "debug", false, "enable debug output ." );
27
options.addOption("d", "debug", false, "enable debug output .");
31
29
CommandLine commandline = null;
33
31
// Parse command line arguments
35
commandline = parser.parse( options, args );
37
catch( ParseException exp ) {
33
commandline = parser.parse(options, args);
34
} catch (ParseException exp) {
38
35
System.err.println("There where an error parsing the specifyed arguments");
39
System.err.println( "Unexpected exception:" + exp.getMessage() );
36
System.err.println("Unexpected exception:" + exp.getMessage());
42
//Create the TAPAAL GUI
39
// Create the TAPAAL GUI
46
if( commandline.hasOption("debug") ) {
47
Logger.enableLogging(true);
51
List<String> files = commandline.getArgList();
52
for (String f : files){
53
File file = new File(f);
55
if (file.exists()) { //Open the file
57
CreateGui.appGui.createNewTabFromFile(file);
58
}else if (file.exists()) {
59
System.err.println("Can not read file " + file.toString());
62
//XXX: Can we create the file? what would the default file type be?
63
//XXX: Can we check if we can write to the directory?
64
System.err.println("Can not find file " + file.toString());
43
if (commandline.hasOption("debug")) {
44
Logger.enableLogging(true);
48
String[] files = commandline.getArgs();
49
for (String f : files) {
50
File file = new File(f);
52
if (file.exists()) { // Open the file
54
CreateGui.appGui.createNewTabFromFile(file);
55
} else if (file.exists()) {
56
System.err.println("Can not read file " + file.toString());
59
// XXX: Can we create the file? what would the default file type
61
// XXX: Can we check if we can write to the directory?
62
System.err.println("Can not find file " + file.toString());