The pseudo-file '-', referring to standard input, is now accepted as a
command-line argument.
This commit is contained in:
parent
900f7492b0
commit
afe73c2228
1 changed files with 7 additions and 3 deletions
|
@ -126,17 +126,21 @@ public class TibetanConverter {
|
||||||
+ ThdlVersion.getTimeOfCompilation());
|
+ ThdlVersion.getTimeOfCompilation());
|
||||||
return 77;
|
return 77;
|
||||||
}
|
}
|
||||||
String tmwRtfPath = args[args.length - 1];
|
String inputRtfPath = args[args.length - 1];
|
||||||
|
|
||||||
DuffPane dp = new DuffPane();
|
DuffPane dp = new DuffPane();
|
||||||
// Read in the rtf file.
|
// Read in the rtf file.
|
||||||
{
|
{
|
||||||
InputStream in = new FileInputStream(tmwRtfPath);
|
InputStream in;
|
||||||
|
if (inputRtfPath.equals("-"))
|
||||||
|
in = System.in;
|
||||||
|
else
|
||||||
|
in = new FileInputStream(inputRtfPath);
|
||||||
try {
|
try {
|
||||||
dp.rtfEd.read(in, dp.getDocument(), 0);
|
dp.rtfEd.read(in, dp.getDocument(), 0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
out.println("TibetanConverter:\n"
|
out.println("TibetanConverter:\n"
|
||||||
+ rtfErrorMessage);
|
+ rtfErrorMessage);
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
in.close();
|
in.close();
|
||||||
|
|
Loading…
Reference in a new issue