You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@juneau.apache.org by GitBox <gi...@apache.org> on 2018/11/29 14:08:54 UTC

[GitHub] jamesbognar closed pull request #21: Added remove option for config command

jamesbognar closed pull request #21: Added remove option for config command
URL: https://github.com/apache/juneau/pull/21
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/console/ConfigCommand.java b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/console/ConfigCommand.java
index 57c256945..b831a3053 100644
--- a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/console/ConfigCommand.java
+++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/console/ConfigCommand.java
@@ -73,6 +73,18 @@ public boolean execute(Scanner in, PrintWriter out, Args args) {
 				} else {
 					out.println(mb.getString("TooManyArguments"));
 				}
+			} else if (option.equals("remove")) {
+				// config remove <key>
+				if (args.size() == 3) {
+					if (conf.getString(key) != null) {
+						conf.remove(key);
+						out.println(mb.getString("ConfigRemove", key));
+					} else {
+						out.println(mb.getString("KeyNotFound", key));
+					}
+				} else {
+					out.println(mb.getString("TooManyArguments"));
+				}
 			} else {
 				out.println(mb.getString("InvalidArguments"));
 			}
diff --git a/juneau-microservice/juneau-microservice-server/src/main/resources/org/apache/juneau/microservice/console/Messages.properties b/juneau-microservice/juneau-microservice-server/src/main/resources/org/apache/juneau/microservice/console/Messages.properties
index 05f0fee95..89b805f70 100644
--- a/juneau-microservice/juneau-microservice-server/src/main/resources/org/apache/juneau/microservice/console/Messages.properties
+++ b/juneau-microservice/juneau-microservice-server/src/main/resources/org/apache/juneau/microservice/console/Messages.properties
@@ -39,3 +39,4 @@ ConfigCommand.InvalidArguments = Invalid or missing arguments for config command
 ConfigCommand.TooManyArguments = Too many arguments for config command
 ConfigCommand.KeyNotFound = key ''{0}'' is not found in current configuration
 ConfigCommand.ConfigSet = Configuration updated.
+ConfigCommand.ConfigRemove = key ''{0}'' was removed.


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services