only print loaded rc file msg if interactive

This commit is contained in:
Doug MacEachern 2005-05-13 18:11:32 +00:00
parent 3d5e199f5b
commit fade72859d
1 changed files with 8 additions and 3 deletions

View File

@ -146,7 +146,9 @@ public class Shell extends ShellBase {
try {
File rc = new File(dir, RCFILE_NAME);
readRCFile(rc, false);
this.out.println("Loaded rc file: " + rc);
if (this.isInteractive) {
this.out.println("Loaded rc file: " + rc);
}
} catch (IOException e) { }
}
@ -160,6 +162,10 @@ public class Shell extends ShellBase {
Shell shell = new Shell();
try {
if (args.length == 0) {
shell.isInteractive = true;
}
shell.init("sigar", System.out, System.err);
shell.registerCommands();
@ -167,8 +173,7 @@ public class Shell extends ShellBase {
shell.readCommandFile(".");
shell.readCommandFile(SigarLoader.getLocation());
if (args.length == 0) {
shell.isInteractive = true;
if (shell.isInteractive) {
shell.initHistory();
Getline.setCompleter(shell);
shell.run();