X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fgofetch%2FMain.java;h=1672c88ef5ae140317760d98798ea7f775bcc1b1;hb=9cf08a99ce4a796a2294fa1f14315aa16d97c3ce;hp=590d4a0cd1046ffedf816052921d34cfb1784465;hpb=737852686d8897331706ed4b902dbd9d5038cb53;p=gofetch.git diff --git a/src/be/nikiroo/gofetch/Main.java b/src/be/nikiroo/gofetch/Main.java index 590d4a0..1672c88 100644 --- a/src/be/nikiroo/gofetch/Main.java +++ b/src/be/nikiroo/gofetch/Main.java @@ -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 +}