fix commandline option in PPTX2PNG from quite to quiet

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1721469 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2015-12-22 22:36:33 +00:00
parent 0a3370347e
commit c9dee45744

View File

@ -38,7 +38,7 @@ import org.apache.poi.sl.usermodel.SlideShowFactory;
import org.apache.poi.util.JvmBugs; import org.apache.poi.util.JvmBugs;
/** /**
* An utulity to convert slides of a .pptx slide show to a PNG image * An utility to convert slides of a .pptx slide show to a PNG image
* *
* @author Yegor Kozlov * @author Yegor Kozlov
*/ */
@ -53,7 +53,7 @@ public class PPTX2PNG {
" -slide <integer> 1-based index of a slide to render\n" + " -slide <integer> 1-based index of a slide to render\n" +
" -format <type> png,gif,jpg (,null for testing)" + " -format <type> png,gif,jpg (,null for testing)" +
" -outdir <dir> output directory, defaults to origin of the ppt/pptx file" + " -outdir <dir> output directory, defaults to origin of the ppt/pptx file" +
" -quite do not write to console (for normal processing)"; " -quiet do not write to console (for normal processing)";
System.out.println(msg); System.out.println(msg);
// no System.exit here, as we also run in junit tests! // no System.exit here, as we also run in junit tests!
@ -70,7 +70,7 @@ public class PPTX2PNG {
File file = null; File file = null;
String format = "png"; String format = "png";
File outdir = null; File outdir = null;
boolean quite = false; boolean quiet = false;
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
if (args[i].startsWith("-")) { if (args[i].startsWith("-")) {
@ -82,8 +82,8 @@ public class PPTX2PNG {
format = args[++i]; format = args[++i];
} else if ("-outdir".equals(args[i])) { } else if ("-outdir".equals(args[i])) {
outdir = new File(args[++i]); outdir = new File(args[++i]);
} else if ("-quite".equals(args[i])) { } else if ("-quiet".equals(args[i])) {
quite = true; quiet = true;
} }
} else { } else {
file = new File(args[i]); file = new File(args[i]);
@ -114,7 +114,7 @@ public class PPTX2PNG {
return; return;
} }
if (!quite) { if (!quiet) {
System.out.println("Processing " + file); System.out.println("Processing " + file);
} }
SlideShow<?,?> ss = SlideShowFactory.create(file, null, true); SlideShow<?,?> ss = SlideShowFactory.create(file, null, true);
@ -134,7 +134,7 @@ public class PPTX2PNG {
for(Slide<?,?> slide : slides) { for(Slide<?,?> slide : slides) {
if (slidenum == -1 || slideNo == slidenum) { if (slidenum == -1 || slideNo == slidenum) {
String title = slide.getTitle(); String title = slide.getTitle();
if (!quite) { if (!quiet) {
System.out.println("Rendering slide " + slideNo + (title == null ? "" : ": " + title)); System.out.println("Rendering slide " + slideNo + (title == null ? "" : ": " + title));
} }
@ -164,9 +164,11 @@ public class PPTX2PNG {
slideNo++; slideNo++;
} }
if (!quite) { if (!quiet) {
System.out.println("Done"); System.out.println("Done");
} }
ss.close();
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")