Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2012-11-21 22:19:17 +0000
committerRoberto E. Escobar2012-11-21 22:19:17 +0000
commit90c0174dd8460b035c168770f831eb7b4787fb84 (patch)
tree2f54640dc0b60a4236eff7da8c106f20e1cab852 /plugins/org.eclipse.osee.console.admin
parentb306388b2c3417afbfee2fdcd71b3c515d5316ab (diff)
downloadorg.eclipse.osee-90c0174dd8460b035c168770f831eb7b4787fb84.tar.gz
org.eclipse.osee-90c0174dd8460b035c168770f831eb7b4787fb84.tar.xz
org.eclipse.osee-90c0174dd8460b035c168770f831eb7b4787fb84.zip
refactor[ats_WSP09]: Update branch_purge command to be safer
Diffstat (limited to 'plugins/org.eclipse.osee.console.admin')
-rw-r--r--plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/ConsoleParameters.java3
-rw-r--r--plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/internal/ConsoleAdminUtils.java7
-rw-r--r--plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/internal/ConsoleParametersImpl.java10
3 files changed, 18 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/ConsoleParameters.java b/plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/ConsoleParameters.java
index 5b9c316cdc7..c719b2d7d7a 100644
--- a/plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/ConsoleParameters.java
+++ b/plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/ConsoleParameters.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.console.admin;
+import java.util.Collection;
import java.util.Date;
/**
@@ -39,4 +40,6 @@ public interface ConsoleParameters {
boolean exists(String key);
+ Collection<String> getOptions();
+
}
diff --git a/plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/internal/ConsoleAdminUtils.java b/plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/internal/ConsoleAdminUtils.java
index 1bb39a77d4b..17224ee6df1 100644
--- a/plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/internal/ConsoleAdminUtils.java
+++ b/plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/internal/ConsoleAdminUtils.java
@@ -15,8 +15,10 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.eclipse.osee.console.admin.ConsoleCommand;
import org.eclipse.osee.console.admin.ConsoleParameters;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
@@ -85,6 +87,7 @@ public final class ConsoleAdminUtils {
String commandName = "";
StringBuilder rawString = new StringBuilder();
PropertyStore store = new PropertyStore();
+ Set<String> options = new HashSet<String>();
int count = 0;
String arg = ci.nextArgument();
@@ -107,6 +110,8 @@ public final class ConsoleAdminUtils {
store.put(key, arrayVal);
}
}
+ } else if (arg.startsWith("-")) {
+ options.add(arg.substring(1));
}
}
}
@@ -116,7 +121,7 @@ public final class ConsoleAdminUtils {
rawString.append(" ");
}
}
- return new ConsoleParametersImpl(commandName, rawString.toString(), store);
+ return new ConsoleParametersImpl(commandName, rawString.toString(), store, options);
}
public static void checkNotNull(Object object, String objectName) throws IllegalArgumentException {
diff --git a/plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/internal/ConsoleParametersImpl.java b/plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/internal/ConsoleParametersImpl.java
index 21bc3c1d3d5..2e99e232616 100644
--- a/plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/internal/ConsoleParametersImpl.java
+++ b/plugins/org.eclipse.osee.console.admin/src/org/eclipse/osee/console/admin/internal/ConsoleParametersImpl.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.console.admin.internal;
+import java.util.Collection;
import java.util.Date;
import org.eclipse.osee.console.admin.ConsoleParameters;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
@@ -23,11 +24,13 @@ public class ConsoleParametersImpl implements ConsoleParameters {
private final String commandName;
private final String rawString;
private final PropertyStore store;
+ private final Collection<String> options;
- public ConsoleParametersImpl(String commandName, String rawString, PropertyStore store) {
+ public ConsoleParametersImpl(String commandName, String rawString, PropertyStore store, Collection<String> options) {
this.commandName = commandName;
this.rawString = rawString;
this.store = store;
+ this.options = options;
}
@Override
@@ -86,4 +89,9 @@ public class ConsoleParametersImpl implements ConsoleParameters {
return commandName;
}
+ @Override
+ public Collection<String> getOptions() {
+ return options;
+ }
+
}

Back to the top