diff --git a/core/src/main/java/com/taobao/arthas/core/command/klass100/RedefineCommand.java b/core/src/main/java/com/taobao/arthas/core/command/klass100/RedefineCommand.java index 1edada2d..5bb943e8 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/klass100/RedefineCommand.java +++ b/core/src/main/java/com/taobao/arthas/core/command/klass100/RedefineCommand.java @@ -15,6 +15,7 @@ import org.objectweb.asm.ClassReader; import com.taobao.arthas.core.command.Constants; import com.taobao.arthas.core.shell.command.AnnotatedCommand; import com.taobao.arthas.core.shell.command.CommandProcess; +import com.taobao.middleware.cli.annotations.Argument; import com.taobao.middleware.cli.annotations.Description; import com.taobao.middleware.cli.annotations.Name; import com.taobao.middleware.cli.annotations.Option; @@ -29,8 +30,8 @@ import com.taobao.middleware.cli.annotations.Summary; @Name("redefine") @Summary("Redefine classes. @see Instrumentation#redefineClasses(ClassDefinition...)") @Description(Constants.EXAMPLE + - " redefine -p /tmp/Test.class\n" + - " redefine -c 327a647b -p /tmp/Test.class /tmp/Test\\$Inner.class \n" + + " redefine /tmp/Test.class\n" + + " redefine -c 327a647b /tmp/Test.class /tmp/Test\\$Inner.class \n" + Constants.WIKI + Constants.WIKI_HOME + "redefine") public class RedefineCommand extends AnnotatedCommand { @@ -46,19 +47,14 @@ public class RedefineCommand extends AnnotatedCommand { this.hashCode = hashCode; } - @Option(shortName = "p", longName = "path", acceptMultipleValues = true) + @Argument(argName = "classfilePaths", index = 0) @Description(".class file paths") - public void setPathPatterns(List paths) { + public void setPaths(List paths) { this.paths = paths; } @Override public void process(CommandProcess process) { - if (paths == null || paths.isEmpty()) { - process.write("paths is empty.\n"); - process.end(); - return; - } Instrumentation inst = process.session().getInstrumentation(); for (String path : paths) {