Switch to using System.err.println() for help 65/4165/1
authorRobert Varga <rovarga@cisco.com>
Mon, 13 Jan 2014 09:34:11 +0000 (10:34 +0100)
committerRobert Varga <rovarga@cisco.com>
Mon, 13 Jan 2014 09:34:11 +0000 (10:34 +0100)
Change-Id: Ie7a1b1df9393d03472b7975534dda0f2e39eb3b9
Signed-off-by: Robert Varga <rovarga@cisco.com>
bgp/testtool/src/main/java/org/opendaylight/protocol/bgp/testtool/Main.java
pcep/testtool/src/main/java/org/opendaylight/protocol/pcep/testtool/Main.java

index 89ff6642a1f28d16640fa4dce2e73773b613d370..05c9a75d94495b3c18657571885b501809885a5f 100644 (file)
@@ -39,7 +39,7 @@ public final class Main {
 
        private static final Logger LOG = LoggerFactory.getLogger(Main.class);
 
-       private static String usage = "DESCRIPTION:\n"
+       private static final String USAGE = "DESCRIPTION:\n"
                        + "\tCreates a server with given parameters. As long as it runs, it accepts connections " + "from PCCs.\n" + "USAGE:\n"
                        + "\t-a, --address\n" + "\t\tthe ip address to which is this server bound.\n"
                        + "\t\tFormat: x.x.x.x:y where y is port number.\n\n"
@@ -66,8 +66,8 @@ public final class Main {
        }
 
        public static void main(final String[] args) throws Exception {
-               if (args.length == 0 || args.length == 1 && args[0].equalsIgnoreCase("--help")) {
-                       System.out.println(Main.usage);
+               if (args.length == 0 || (args.length == 1 && args[0].equalsIgnoreCase("--help"))) {
+                       System.err.println(Main.USAGE);
                        return;
                }
 
index 6106a0a6cdb406fa5f54319301656ebcaea8e934..2dca3180d9d121dc8eda3c11eb5f799cc3fb8064 100644 (file)
@@ -26,7 +26,8 @@ public final class Main {
 
        private static final Logger LOG = LoggerFactory.getLogger(Main.class);
 
-       public static String usage = "DESCRIPTION:\n" + "\tCreates a server with given parameters. As long as it runs, it accepts connections "
+       public static final String USAGE = "DESCRIPTION:\n"
+                       + "\tCreates a server with given parameters. As long as it runs, it accepts connections "
                        + "from PCCs.\n" + "USAGE:\n" + "\t-a, --address\n" + "\t\tthe ip address to which is this server bound.\n"
                        + "\t\tFormat: x.x.x.x:y where y is port number.\n\n" +
 
@@ -68,8 +69,8 @@ public final class Main {
        }
 
        public static void main(final String[] args) throws Exception {
-               if (args.length == 0 || args.length == 1 && args[0].equalsIgnoreCase("--help")) {
-                       System.out.println(Main.usage);
+               if (args.length == 0 || (args.length == 1 && args[0].equalsIgnoreCase("--help"))) {
+                       System.err.println(Main.USAGE);
                        return;
                }