Minor fixes for CLI Tinfoil/Awoo Net-install mode.

This commit is contained in:
Dmitry Isaenko 2020-07-06 14:06:59 +03:00
parent 3690c63399
commit 51938df434

View file

@ -27,7 +27,7 @@ import java.util.List;
// TODO: Add 'don't serve requests' option // TODO: Add 'don't serve requests' option
public class TinfoilNet { public class TinfoilNet {
private String[] arguments; private final String[] arguments;
private String nsIp; private String nsIp;
@ -43,7 +43,7 @@ public class TinfoilNet {
this.arguments = arguments; this.arguments = arguments;
checkArguments(); checkArguments();
parseNsIP(); parseNsIP();
parseHostIPAndExtras(); parseHostSettings();
parseFilesArguments(); parseFilesArguments();
runTinfoilNetBackend(); runTinfoilNetBackend();
} }
@ -73,8 +73,8 @@ public class TinfoilNet {
private boolean isHelpDirective(String argument){ private boolean isHelpDirective(String argument){
return argument.equals("help"); return argument.equals("help");
} }
private void showHelp(){ private void showHelp() throws IncorrectSetupException{
System.out.println("Usage:\n" throw new IncorrectSetupException("Usage:\n"
+ "\tns-usbloader -n nsip=<arg1> [hostip=<arg2>] FILE1 ...\n" + "\tns-usbloader -n nsip=<arg1> [hostip=<arg2>] FILE1 ...\n"
+ "\tns-usbloader --tfn nsip=<arg1> [hostip=<arg2>] FILE1 ..." + "\tns-usbloader --tfn nsip=<arg1> [hostip=<arg2>] FILE1 ..."
+ "\n\nOptions:" + "\n\nOptions:"
@ -96,7 +96,7 @@ public class TinfoilNet {
"Try 'ns-usbloader -n help' for more information."); "Try 'ns-usbloader -n help' for more information.");
} }
private void parseHostIPAndExtras(){ private void parseHostSettings(){
String argument2 = arguments[1]; String argument2 = arguments[1];
if (! argument2.startsWith("hostip=")) if (! argument2.startsWith("hostip="))