knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmc...@apache.org
Subject knox git commit: KNOX-480 KnoxCLI needs to print usage when alias not provided
Date Tue, 16 Dec 2014 15:37:01 GMT
Repository: knox
Updated Branches:
  refs/heads/master 711f14fd2 -> 92f296502


KNOX-480 KnoxCLI needs to print usage when alias not provided

Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/92f29650
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/92f29650
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/92f29650

Branch: refs/heads/master
Commit: 92f2965020a7fcdcaf924d32fd503b87b3570c29
Parents: 711f14f
Author: Larry McCay <lmccay@hortonworks.com>
Authored: Tue Dec 16 10:36:44 2014 -0500
Committer: Larry McCay <lmccay@hortonworks.com>
Committed: Tue Dec 16 10:36:44 2014 -0500

----------------------------------------------------------------------
 CHANGES                                               |  1 +
 .../java/org/apache/hadoop/gateway/util/KnoxCLI.java  | 14 ++++++++++----
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/92f29650/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 8043437..6bc2b1a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,7 @@ Release Notes - Apache Knox - Version 0.6.0
 ------------------------------------------------------------------------------
 ** New Feature
   * [KNOX-473] - Configurable front end URL for simplified load balancer configuration
+  * [KNOX-480] - KnoxCLI needs to print usage when alias not provided
 
 ------------------------------------------------------------------------------
 Release Notes - Apache Knox - Version 0.5.1

http://git-wip-us.apache.org/repos/asf/knox/blob/92f29650/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java
index 6b6587b..3840e9c 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java
@@ -144,16 +144,22 @@ public class KnoxCLI extends Configured implements Tool {
           return -1;
         }
       } else if (args[i].equals("delete-alias")) {
-        String alias = args[++i];
+        String alias = null;
+        if (args.length >= 2) {
+          alias = args[++i];
+        }
         command = new AliasDeleteCommand(alias);
-        if (alias.equals("--help")) {
+        if (alias == null || alias.equals("--help")) {
           printKnoxShellUsage();
           return -1;
         }
       } else if (args[i].equals("create-alias")) {
-        String alias = args[++i];
+        String alias = null;
+        if (args.length >= 2) {
+          alias = args[++i];
+        }
         command = new AliasCreateCommand(alias);
-        if (alias.equals("--help")) {
+        if (alias == null || alias.equals("--help")) {
           printKnoxShellUsage();
           return -1;
         }


Mime
View raw message