Add support for 7sur7.be
[gofetch.git] / src / be / nikiroo / gofetch / Main.java
index 590d4a0cd1046ffedf816052921d34cfb1784465..1672c88ef5ae140317760d98798ea7f775bcc1b1 100644 (file)
@@ -3,7 +3,7 @@ package be.nikiroo.gofetch;
 import java.io.File;
 import java.io.IOException;
 
-import be.nikiroo.gofetch.support.BasicSupport.Type;
+import be.nikiroo.gofetch.support.Type;
 
 /**
  * This class is tha main entry point of the program. It will parse the
@@ -52,7 +52,10 @@ public class Main {
                        System.exit(1);
                }
 
-               // Selector base (empty is ok, DO NOT end with /)
+               // Selector base :
+               // - empty is ok
+               // - DO NOT end with /
+               // - always starts with / if not empty
                String preselector = "";
                if (preselectorStr != null && !preselectorStr.startsWith("/")) {
                        preselector = "/" + preselectorStr;
@@ -65,7 +68,7 @@ public class Main {
                Type type = null;
                if (!"ALL".equals(typeStr)) {
                        try {
-                               Type.valueOf(typeStr.toUpperCase());
+                               type = Type.valueOf(typeStr.toUpperCase());
                        } catch (IllegalArgumentException e) {
                                System.err.println("Invalid type: " + typeStr);
                                System.exit(1);
@@ -102,4 +105,4 @@ public class Main {
 
                new Fetcher(dir, preselector, type, maxStories, hostname, port).start();
        }
-}
\ No newline at end of file
+}