Library scanning much quicker
[fanfix.git] / src / be / nikiroo / fanfix / Main.java
index 10bccec650d7e4f9f33073502f553860e5f4229a..0938fea9b2ca9fd2e87f96a5a7307cab3060e876 100644 (file)
@@ -62,10 +62,9 @@ public class Main {
                String typeString = null;
                String chapString = null;
                String target = null;
-               String readerTypeString = null;
-               MainAction action = null;
+               MainAction action = MainAction.HELP;
                Boolean plusInfo = null;
-
+               
                boolean noMoreActions = false;
 
                int exitCode = 0;
@@ -153,11 +152,7 @@ public class Main {
                                exitCode = 255;
                                break;
                        case SET_READER:
-                               if (readerTypeString == null) {
-                                       readerTypeString = args[i];
-                               } else {
-                                       exitCode = 255;
-                               }
+                               exitCode = setReaderType(args[i]);
                                break;
                        }
                }
@@ -188,7 +183,6 @@ public class Main {
                                exitCode = 0;
                                break;
                        case SET_READER:
-                               exitCode = setReaderType(readerTypeString);
                                break;
                        }
                }
@@ -474,7 +468,8 @@ public class Main {
         */
        private static int setReaderType(String readerTypeString) {
                try {
-                       ReaderType readerType = ReaderType.valueOf(readerTypeString);
+                       ReaderType readerType = ReaderType.valueOf(readerTypeString
+                                       .toUpperCase());
                        BasicReader.setDefaultReaderType(readerType);
                        return 0;
                } catch (IllegalArgumentException e) {