package de.oppermann.pomutils.commands;

import com.beust.jcommander.IStringConverter;
import com.beust.jcommander.ParameterException;

import de.oppermann.pomutils.select.SelectionStrategy;

public class SelectionStrategyConverter implements IStringConverter<SelectionStrategy> {

	@Override
	public SelectionStrategy convert(String value) {
		if (value == null) {
			return SelectionStrategy.OUR;
		}

		try {
			return SelectionStrategy.valueOf(value.toUpperCase());
		} catch (IllegalArgumentException e) {
			throw new ParameterException("--select must be one of 'ours', 'theirs', or 'prompt'");
		}
	}

}

@@ -565,17 +565,16 @@
  of 'our
-s
 ', 'thei
@@ -574,17 +574,16 @@
 , 'their
-s
 ', or 'p

Fix error message for illegal select value