- files.add(new File("/home/niki/vcf/coworkers.vcf"));
- files.add(new File("/home/niki/vcf/oce.vcf"));
- win = new MainWindow(new FileList(files));
- //
+ for (String arg : args) {
+ if (!noMoreParams && arg.equals("--")) {
+ noMoreParams = true;
+ } else if (!noMoreParams && arg.equals("--help")) {
+ System.out
+ .println("TODO: implement some help text.\n"
+ + "Usable switches:\n"
+ + "\t--: stop looking for switches\n"
+ + "\t--help: this here thingy\n"
+ + "\t--tui: force pure text mode even if swing treminal is available\n"
+ + "\t--gui: force swing terminal mode\n"
+ + "\t--noutf: force non-utf8 mode if you need it\n"
+ + "\t--noutfa: force non-utf8 and no accents mode if you need it\n"
+ + "everyhing else is either a file to open or a directory to open\n"
+ + "(we will only open 1st level files in given directories)");
+ return;
+ } else if (!noMoreParams && arg.equals("--tui")) {
+ textMode = true;
+ } else if (!noMoreParams && arg.equals("--gui")) {
+ textMode = false;
+ } else if (!noMoreParams && arg.equals("--noutf")) {
+ UiColors.getInstance().setUnicode(false);
+ } else {
+ filesTried = true;
+ files.addAll(open(arg));
+ }
+ }
+
+ if (files.size() == 0) {
+ if (filesTried) {
+ System.exit(1);
+ return;
+ }