[HUDSON-1454] Improved the CLI option parsing to recognize "-Px,y,z" as profiles. This will be in 1.283.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15165 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-02-09 19:51:56 +00:00
1 parent 8288bd5bba
commit fa2f77ec9c
1 file changed
+12 -3
@@ -490,14 +490,23 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
* return the configured profiles. Otherwise null.
*/
public String getProfiles() {
StringBuilder buf = new StringBuilder();
boolean switchFound=false;
for (String t : Util.tokenize(getGoals())) {
if(switchFound)
return t;
if(switchFound) {
buf.append(',').append(t);
switchFound = false;
}
if(t.equals("-P"))
switchFound=true;
else
if(t.startsWith("-P")) {
// -Px,y,z
buf.append(',').append(t.substring(2));
}
}
return null;
if(buf.length()==0) return null;
return buf.substring(1);
}
/**