package org.kohsuke.args4j.spi;

import java.util.UUID;

import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.OptionDef;

/**
 * {@link UUID} {@link OptionHandler}.
 *
 * @author Tobias Stolzmann
 */
public class UuidOptionHandler extends
		OneArgumentOptionHandler<UUID> {
	public UuidOptionHandler(CmdLineParser parser, OptionDef option,
			Setter<? super UUID> setter) {
		super(parser, option, setter);
	}

	@Override
	protected UUID parse(String argument) throws CmdLineException {
		try {
			return UUID.fromString(argument);
		} catch (IllegalArgumentException e) {
			throw new CmdLineException(owner,
					Messages.ILLEGAL_UUID.format(argument));
		}
	}

	@Override
	public String getDefaultMetaVariable() {
		return "<uuid>";
	}
}

@@ -247,16 +247,48 @@
 olzmann%0A
+ * @see UUID#fromString(String)%0A
  */%0Apubl
@@ -578,16 +578,186 @@
 %09%09try %7B%0A
+            if (argument.startsWith(%22%7B%22))   argument=argument.substring(1);%0A            if (argument.endsWith(%22%7D%22))   argument=argument.substring(0,argument.length()-1);%0A
 %09%09%09retur

trim off brackets around it