cp "$$ln" "../bin/$$ln" ; \
fi ; \
done
+ @cp VERSION bin/
test-resources: resources
@echo Copying test resources into bin/...
echo "TEST_PARAMS = $cols $ok $ko" >> Makefile
echo "NAME = fanfix" >> Makefile
echo "PREFIX = $PREFIX" >> Makefile
-echo "JAR_FLAGS += -C bin/ org -C bin/ be -C ./ VERSION" >> Makefile
+echo "JAR_FLAGS += -C bin/ org -C bin/ be -C bin/ VERSION" >> Makefile
#echo "SJAR_FLAGS += -C src/ org -C src/ be -C ./ LICENSE -C ./ README.md -C ./ VERSION" >> Makefile
cat Makefile.base >> Makefile
configDir = new File(System.getProperty("user.home"), ".fanfix")
.getPath();
}
-
+
if (configDir != null) {
if (!new File(configDir).exists()) {
new File(configDir).mkdirs();
/**
* Get the (unique) {link StringIdBundle} for the program.
- *
+ *
* @return the {link StringIdBundle}
*/
public static StringIdBundle getTrans() {
import be.nikiroo.fanfix.supported.BasicSupport;
import be.nikiroo.fanfix.supported.BasicSupport.SupportType;
import be.nikiroo.utils.Progress;
+import be.nikiroo.utils.Version;
import be.nikiroo.utils.ui.UIUtils;
/**
*/
public class Main {
private enum MainAction {
- IMPORT, EXPORT, CONVERT, READ, READ_URL, LIST, HELP, SET_READER, START,
+ IMPORT, EXPORT, CONVERT, READ, READ_URL, LIST, HELP, SET_READER, START, VERSION,
}
/**
* <li>--list ([type]): list the stories present in the library</li>
* <li>--set-reader [reader type]: set the reader type to CLI or LOCAL for
* this command</li>
+ * <li>--version: get the version of the program</li>
* </ul>
*
* @param args
case START:
exitCode = 255; // not supposed to be selected by user
break;
+ case VERSION:
+ exitCode = 255; // no arguments for this option
}
}
break;
case SET_READER:
break;
+ case VERSION:
+ System.out
+ .println(String.format("Fanfix version %s"
+ + "\nhttps://github.com/nikiroo/fanfix/"
+ + "\n\tWritten by Nikiroo",
+ Version.getCurrentVersion()));
+ break;
case START:
UIUtils.setLookAndFeel();
BasicReader.setDefaultReaderType(ReaderType.LOCAL);
\t--list: list the stories present in the library\n\
\t--set-reader [reader type]: set the reader type to CLI or LOCAL for this command\n\
\t--help: this help message\n\
+\t--version: return the version of the program\n\
\n\
Supported input types:\n\
%s\n\
import be.nikiroo.fanfix.output.BasicOutput.OutputType;
import be.nikiroo.fanfix.reader.LocalReaderBook.BookActionListener;
import be.nikiroo.utils.Progress;
+import be.nikiroo.utils.Version;
import be.nikiroo.utils.ui.ProgressBar;
import be.nikiroo.utils.ui.WrapLayout;
* the type of {@link Story} to load, or NULL for all types
*/
public LocalReaderFrame(LocalReader reader, String type) {
- super("Fanfix Library");
+ super(String.format("Fanfix %s Library", Version.getCurrentVersion()));
this.reader = reader;