Merge branch 'master' into bytekit

This commit is contained in:
hengyunabc
2020-05-20 03:28:09 +08:00
14 changed files with 42 additions and 14 deletions
@@ -75,6 +75,7 @@ public class Arthas {
String pid = descriptor.id();
if (pid.equals(Long.toString(configure.getJavaPid()))) {
virtualMachineDescriptor = descriptor;
break;
}
}
VirtualMachine virtualMachine = null;
@@ -29,7 +29,7 @@ public class HistoryCommand extends AnnotatedCommand {
boolean clear = false;
int n = -1;
@Option(shortName = "c", longName = "clear")
@Option(shortName = "c", longName = "clear", flag = true , acceptValue = false)
@Description("clear history")
public void setClear(boolean clear) {
this.clear = clear;
@@ -56,7 +56,7 @@ public class HistoryCommand extends AnnotatedCommand {
StringBuilder sb = new StringBuilder();
int size = history.size();
if (n < 0) {
if (n < 0 || n > size) {
n = size;
}
@@ -81,7 +81,7 @@ public class LoggerCommand extends AnnotatedCommand {
private String level;
/**
* include the logger don't have appender, default false.
* include the loggers which don't have appenders, default false.
*/
private boolean includeNoAppender;
@@ -104,7 +104,7 @@ public class LoggerCommand extends AnnotatedCommand {
}
@Option(longName = "include-no-appender", flag = true)
@Description("include the loggers don't have appender, default value false")
@Description("include the loggers which don't have appenders, default value false")
public void setHaveAppender(boolean includeNoAppender) {
this.includeNoAppender = includeNoAppender;
}
@@ -10,6 +10,7 @@ import com.taobao.arthas.core.shell.command.CommandProcess;
import com.taobao.arthas.core.util.SearchUtils;
import com.taobao.arthas.core.util.matcher.Matcher;
import com.taobao.middleware.cli.annotations.Argument;
import com.taobao.middleware.cli.annotations.DefaultValue;
import com.taobao.middleware.cli.annotations.Description;
import com.taobao.middleware.cli.annotations.Name;
import com.taobao.middleware.cli.annotations.Option;
@@ -54,7 +55,8 @@ public class WatchCommand extends EnhancerCommand {
this.methodPattern = methodPattern;
}
@Argument(index = 2, argName = "express")
@Argument(index = 2, argName = "express", required = false)
@DefaultValue("{params, target, returnObj}")
@Description("the content you want to watch, written by ognl.\n" + Constants.EXPRESS_EXAMPLES)
public void setExpress(String express) {
this.express = express;