mirror of
https://github.com/revanced/smali.git
synced 2025-06-12 12:17:37 +02:00
Clean up how the usage messages are printed
This also fixes an OOM issue when trying to print the usage message on a terminal that doesn't report its width.
This commit is contained in:
@ -31,12 +31,17 @@ package org.jf.util;
|
||||
import org.apache.commons.cli.HelpFormatter;
|
||||
import org.apache.commons.cli.Options;
|
||||
|
||||
public class smaliHelpFormatter extends HelpFormatter {
|
||||
import java.io.PrintWriter;
|
||||
|
||||
public void smaliHelpFormatter() {
|
||||
}
|
||||
|
||||
public void renderOptions(StringBuffer sb, Options options) {
|
||||
super.renderOptions(sb, getWidth(), options, getLeftPadding(), this.getDescPadding());
|
||||
public class SmaliHelpFormatter extends HelpFormatter {
|
||||
public void printHelp(String cmdLineSyntax, String header, Options options, Options debugOptions) {
|
||||
super.printHelp(cmdLineSyntax, header, options, "");
|
||||
if (debugOptions != null) {
|
||||
System.out.println();
|
||||
System.out.println("Debug Options:");
|
||||
PrintWriter pw = new PrintWriter(System.out);
|
||||
super.printOptions(pw, getWidth(), debugOptions, getLeftPadding(), getDescPadding());
|
||||
pw.flush();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user