changeset 466:d76b45adf852

removed cyclic maven dependencies
author Devel 1
date Thu, 03 Aug 2017 10:21:23 +0200
parents 5401dadf33bb
children f9c1c9d3fa0f
files stress-tester-reporter/pom.xml stress-tester-reporter/src/main/java/com/passus/st/utils/CliUtils.java
diffstat 2 files changed, 35 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester-reporter/pom.xml	Wed Aug 02 16:15:14 2017 +0200
+++ b/stress-tester-reporter/pom.xml	Thu Aug 03 10:21:23 2017 +0200
@@ -59,12 +59,6 @@
             <artifactId>commons-cli</artifactId>
             <version>1.3.1</version>
         </dependency>
-        <dependency>
-            <groupId>com.passus.st</groupId>
-            <artifactId>stress-tester</artifactId>
-            <version>1.0-SNAPSHOT</version>
-            <type>jar</type>
-        </dependency>
     </dependencies>
     
     <build>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stress-tester-reporter/src/main/java/com/passus/st/utils/CliUtils.java	Thu Aug 03 10:21:23 2017 +0200
@@ -0,0 +1,35 @@
+package com.passus.st.utils;
+
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+
+/**
+ *
+ * @author mikolaj.podbielski
+ */
+public class CliUtils {
+
+    public static Option.Builder option(String opt, String longOpt) {
+        return Option.builder(opt).longOpt(longOpt);
+    }
+
+    public static Option option(String opt, String longopt, String description) {
+        return option(opt, longopt, description, null);
+    }
+
+    public static Option option(String opt, String longopt, String description, String argName) {
+        Option option = new Option(opt, description);
+        option.setLongOpt(longopt);
+        if (argName != null) {
+            option.setArgs(1);
+            option.setArgName(argName);
+        }
+        return option;
+    }
+
+    public static void printHelp(Options options, String syntax) {
+        HelpFormatter formatter = new HelpFormatter();
+        formatter.printHelp(syntax, "---", options, "===");
+    }
+}