default user from properties

This commit is contained in:
Peter Hormanns 2014-09-30 18:51:47 +02:00
parent 5b4d5a1c5d
commit 9ae701677a
2 changed files with 5 additions and 2 deletions

View File

@ -19,7 +19,8 @@ public class Main {
final CommandlineParser cmdParser = new CommandlineParser(args); final CommandlineParser cmdParser = new CommandlineParser(args);
final String runAs = cmdParser.getRunAs(); final String runAs = cmdParser.getRunAs();
console.open(runAs + "@hsadmin> "); console.open(runAs + "@hsadmin> ");
final ScriptClient scriptClient = new ScriptClient(console, cmdParser.getUser(), runAs, cmdParser.getArgs()); final String user = cmdParser.getUser();
final ScriptClient scriptClient = new ScriptClient(console, user, runAs, cmdParser.getArgs());
final String file = cmdParser.getFile(); final String file = cmdParser.getFile();
if (file != null && file.length() > 0) { if (file != null && file.length() > 0) {
if ("-".equals(file)) { if ("-".equals(file)) {

View File

@ -39,7 +39,9 @@ public class CommandlineParser {
} }
public String getUser() { public String getUser() {
return cmd.getOptionValue("user", System.getProperty("user.name")); final String systemUser = System.getProperty("user.name");
final String configUser = Config.getInstance().getProperty("userName", systemUser);
return cmd.getOptionValue("user", configUser);
} }
public String getRunAs() { public String getRunAs() {