default user from properties
This commit is contained in:
parent
5b4d5a1c5d
commit
9ae701677a
@ -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)) {
|
||||||
|
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user