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
Version 1.2.3: new supported type: HTML
[fanfix.git]
/
src
/
be
/
nikiroo
/
fanfix
/
reader
/
CliReader.java
diff --git
a/src/be/nikiroo/fanfix/reader/CliReader.java
b/src/be/nikiroo/fanfix/reader/CliReader.java
index b3dd3edc79300b28c2ea779c91c887bbbbd9d704..5dc228810cfcac16fef2a1e8abc44681b5d96cc5 100644
(file)
--- a/
src/be/nikiroo/fanfix/reader/CliReader.java
+++ b/
src/be/nikiroo/fanfix/reader/CliReader.java
@@
-9,7
+9,6
@@
import be.nikiroo.fanfix.data.Chapter;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Paragraph;
import be.nikiroo.fanfix.data.Story;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Paragraph;
import be.nikiroo.fanfix.data.Story;
-import be.nikiroo.fanfix.supported.BasicSupport.SupportType;
/**
* Command line {@link Story} reader.
/**
* Command line {@link Story} reader.
@@
-59,7
+58,11
@@
class CliReader extends BasicReader {
}
@Override
}
@Override
- public void read(int chapter) {
+ public void read(int chapter) throws IOException {
+ if (getStory() == null) {
+ throw new IOException("No story to read");
+ }
+
if (chapter > getStory().getChapters().size()) {
System.err.println("Chapter " + chapter + ": no such chapter");
} else {
if (chapter > getStory().getChapters().size()) {
System.err.println("Chapter " + chapter + ": no such chapter");
} else {
@@
-75,7
+78,7
@@
class CliReader extends BasicReader {
}
@Override
}
@Override
- public void start(S
upportType
type) {
+ public void start(S
tring
type) {
List<MetaData> stories;
stories = Instance.getLibrary().getList(type);
List<MetaData> stories;
stories = Instance.getLibrary().getList(type);