From 052b9cdf718fe2c4b0a1f4ccb50c60e17b62ad48 Mon Sep 17 00:00:00 2001 From: Panxiaobo Date: Wed, 29 May 2013 19:01:06 +0800 Subject: [PATCH] remove dep from commons-cli --HG-- branch : 0.0.9.x --- dex-tools/pom.xml | 5 - .../com/googlecode/dex2jar/tools/BaseCmd.java | 279 +++++++++++++----- 2 files changed, 208 insertions(+), 76 deletions(-) diff --git a/dex-tools/pom.xml b/dex-tools/pom.xml index 04c7bea0..177ac44a 100755 --- a/dex-tools/pom.xml +++ b/dex-tools/pom.xml @@ -16,11 +16,6 @@ dex-translator ${project.version} - - commons-cli - commons-cli - 1.2 - com.googlecode.dex2jar commons-lite diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java index 38f0b81c..05dd16c2 100755 --- a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java +++ b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java @@ -23,18 +23,19 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.reflect.Field; +import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; +import java.util.List; import java.util.Map; - -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.HelpFormatter; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; -import org.apache.commons.cli.PosixParser; +import java.util.Set; +import java.util.TreeSet; public abstract class BaseCmd { + @SuppressWarnings("serial") + protected static class HelpException extends RuntimeException { + } + @Retention(value = RetentionPolicy.RUNTIME) @Target(value = { ElementType.FIELD }) static protected @interface Opt { @@ -51,6 +52,31 @@ public abstract class BaseCmd { boolean required() default false; } + static protected class Option implements Comparable