From 5dc091d38b2c7d2a8cf358b16e7f8d554a89fa9c Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Tue, 3 Sep 2019 16:01:51 +0800 Subject: [PATCH] update SystemPropertyCommand message. --- .../core/command/basic1000/SystemPropertyCommand.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/taobao/arthas/core/command/basic1000/SystemPropertyCommand.java b/core/src/main/java/com/taobao/arthas/core/command/basic1000/SystemPropertyCommand.java index 8c7df993a..61ef7bb4d 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/basic1000/SystemPropertyCommand.java +++ b/core/src/main/java/com/taobao/arthas/core/command/basic1000/SystemPropertyCommand.java @@ -44,6 +44,7 @@ public class SystemPropertyCommand extends AnnotatedCommand { @Override public void process(CommandProcess process) { + int status = 0; try { if (StringUtils.isBlank(propertyName) && StringUtils.isBlank(propertyValue)) { // show all system properties @@ -52,7 +53,7 @@ public class SystemPropertyCommand extends AnnotatedCommand { // view the specified system property String value = System.getProperty(propertyName); if (value == null) { - process.write("In order to change the system properties, you must specify the property value.\n"); + process.write("There is no property with the key " + propertyName + ".\n"); } else { process.write(propertyName + "=" + value + "\n"); } @@ -64,8 +65,9 @@ public class SystemPropertyCommand extends AnnotatedCommand { } } catch (Throwable t) { process.write("Error during setting system property: " + t.getMessage() + "\n"); + status = 1; } finally { - process.end(); + process.end(status); } }