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 { try {
File rc = new File(dir, RCFILE_NAME); File rc = new File(dir, RCFILE_NAME);
readRCFile(rc, false); readRCFile(rc, false);
this.out.println("Loaded rc file: " + rc); if (this.isInteractive) {
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();