CLI Cleanup

This commit is contained in:
Konloch 2024-10-02 10:14:35 -06:00
parent a5f0aed8e5
commit d4a528ee23

AI 샘플 코드 생성 중입니다

Loading...
3 changed files with 8 additions and 8 deletions

View File

@ -693,7 +693,10 @@ public class BytecodeViewer
*/
public static void handleException(Throwable t, String author)
{
new ExceptionUI(t, author);
if(CLI.isCLI())
t.printStackTrace();
else
new ExceptionUI(t, author);
}
/**

View File

@ -69,18 +69,13 @@ public class BCVCommandLine
{
CommandLine cmd = PARSER.parse(OPTIONS, args);
if(cmd.hasOption("language"))
System.out.println("OK: " + cmd.getOptionValue("language"));
//TODO this is a backwards way of searching and will cause collisions
// I'm sure the Apache CLI has a better way of navigating this
for(CLICommand command : COMMANDS)
{
System.out.println("OK: " + command.name);
if(cmd.hasOption(command.name))
{
System.out.println("ON: " + command.name);
command.runCommand(cmd);
return;
}
@ -115,9 +110,11 @@ public class BCVCommandLine
return;
}
//wait 5 seconds to allow time for reading
if (!cmd.hasOption("nowait"))
SleepUtil.sleep(5 * 1000);
//decompiler configuration
File input = new File(cmd.getOptionValue("i"));
File output = new File(cmd.getOptionValue("o"));
String decompiler = cmd.getOptionValue("decompiler");

View File

@ -28,10 +28,10 @@ public class HelpCommand extends CLICommand
"-o <output file> Selects the output file",
"-t <target classname> Must either be the fully qualified classname or \"all\" to decompile all as zip",
"-nowait Doesn't wait for the user to read the CLI messages",
"",
"==BCV GUI Commands==",
"-cleanboot Deletes the BCV directory and continues to boot into the GUI",
"-english Forces English language translations"
"-language <language> Sets specific language translations"
})
System.out.println(s);
}