From fade72859db5915b955c593012f3da8f53c9518c Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 13 May 2005 18:11:32 +0000 Subject: [PATCH] only print loaded rc file msg if interactive --- bindings/java/src/net/hyperic/sigar/cmd/Shell.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Shell.java b/bindings/java/src/net/hyperic/sigar/cmd/Shell.java index 4be7bdc2..1cd0ba4c 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Shell.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Shell.java @@ -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();