only print loaded rc file msg if interactive
This commit is contained in:
parent
3d5e199f5b
commit
fade72859d
|
@ -146,7 +146,9 @@ public class Shell extends ShellBase {
|
||||||
try {
|
try {
|
||||||
File rc = new File(dir, RCFILE_NAME);
|
File rc = new File(dir, RCFILE_NAME);
|
||||||
readRCFile(rc, false);
|
readRCFile(rc, false);
|
||||||
|
if (this.isInteractive) {
|
||||||
this.out.println("Loaded rc file: " + rc);
|
this.out.println("Loaded rc file: " + rc);
|
||||||
|
}
|
||||||
} catch (IOException e) { }
|
} catch (IOException e) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,6 +162,10 @@ public class Shell extends ShellBase {
|
||||||
Shell shell = new Shell();
|
Shell shell = new Shell();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (args.length == 0) {
|
||||||
|
shell.isInteractive = true;
|
||||||
|
}
|
||||||
|
|
||||||
shell.init("sigar", System.out, System.err);
|
shell.init("sigar", System.out, System.err);
|
||||||
shell.registerCommands();
|
shell.registerCommands();
|
||||||
|
|
||||||
|
@ -167,8 +173,7 @@ public class Shell extends ShellBase {
|
||||||
shell.readCommandFile(".");
|
shell.readCommandFile(".");
|
||||||
shell.readCommandFile(SigarLoader.getLocation());
|
shell.readCommandFile(SigarLoader.getLocation());
|
||||||
|
|
||||||
if (args.length == 0) {
|
if (shell.isInteractive) {
|
||||||
shell.isInteractive = true;
|
|
||||||
shell.initHistory();
|
shell.initHistory();
|
||||||
Getline.setCompleter(shell);
|
Getline.setCompleter(shell);
|
||||||
shell.run();
|
shell.run();
|
||||||
|
|
Loading…
Reference in New Issue