git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some fixes: output types, libraries, remote
[fanfix.git]
/
src
/
be
/
nikiroo
/
fanfix
/
Main.java
diff --git
a/src/be/nikiroo/fanfix/Main.java
b/src/be/nikiroo/fanfix/Main.java
index 9ac48845ce87d4bc57416bfd2daf7e7f30fa4364..c17a1d8b988f0a52c7c763efd9bad67f48bebd92 100644
(file)
--- a/
src/be/nikiroo/fanfix/Main.java
+++ b/
src/be/nikiroo/fanfix/Main.java
@@
-253,12
+253,30
@@
public class Main {
updates.ok(); // we consider it read
break;
case LIST:
updates.ok(); // we consider it read
break;
case LIST:
+ if (BasicReader.getReader() == null) {
+ Instance.syserr(new Exception(
+ "No reader type has been configured"));
+ exitCode = 10;
+ break;
+ }
exitCode = list(sourceString);
break;
case READ:
exitCode = list(sourceString);
break;
case READ:
+ if (BasicReader.getReader() == null) {
+ Instance.syserr(new Exception(
+ "No reader type has been configured"));
+ exitCode = 10;
+ break;
+ }
exitCode = read(luid, chapString, true);
break;
case READ_URL:
exitCode = read(luid, chapString, true);
break;
case READ_URL:
+ if (BasicReader.getReader() == null) {
+ Instance.syserr(new Exception(
+ "No reader type has been configured"));
+ exitCode = 10;
+ break;
+ }
exitCode = read(urlString, chapString, false);
break;
case HELP:
exitCode = read(urlString, chapString, false);
break;
case HELP:
@@
-277,6
+295,12
@@
public class Main {
updates.ok(); // we consider it read
break;
case START:
updates.ok(); // we consider it read
break;
case START:
+ if (BasicReader.getReader() == null) {
+ Instance.syserr(new Exception(
+ "No reader type has been configured"));
+ exitCode = 10;
+ break;
+ }
BasicReader.getReader().browse(null);
break;
case SERVER:
BasicReader.getReader().browse(null);
break;
case SERVER:
@@
-293,7
+317,7
@@
public class Main {
}
return;
case REMOTE:
}
return;
case REMOTE:
- exitCode = 255;
+ exitCode = 255;
// should not be reachable (REMOTE -> START)
break;
}
}
break;
}
}
@@
-348,7
+372,7
@@
public class Main {
*/
public static int export(String luid, String typeString, String target,
Progress pg) {
*/
public static int export(String luid, String typeString, String target,
Progress pg) {
- OutputType type = OutputType.valueOfNullOkUC(typeString);
+ OutputType type = OutputType.valueOfNullOkUC(typeString
, null
);
if (type == null) {
Instance.syserr(new Exception(trans(StringId.OUTPUT_DESC,
typeString)));
if (type == null) {
Instance.syserr(new Exception(trans(StringId.OUTPUT_DESC,
typeString)));
@@
-453,7
+477,7
@@
public class Main {
sourceName = sourceName.substring("file://".length());
}
sourceName = sourceName.substring("file://".length());
}
- OutputType type = OutputType.valueOfAllOkUC(typeString);
+ OutputType type = OutputType.valueOfAllOkUC(typeString
, null
);
if (type == null) {
Instance.syserr(new IOException(trans(
StringId.ERR_BAD_OUTPUT_TYPE, typeString)));
if (type == null) {
Instance.syserr(new IOException(trans(
StringId.ERR_BAD_OUTPUT_TYPE, typeString)));