package org.asciidoctor.jruby.cli;

import com.beust.jcommander.IStringConverter;
import org.asciidoctor.SafeMode;
import org.asciidoctor.log.Severity;

public class SeverityConverter implements IStringConverter<Severity> {

    @Override
    public Severity convert(String argument) { return Severity.valueOf(argument.toUpperCase()); }

}

package org.asciidoctor.jruby.cli;

import com.beust.jcommander.converters.EnumConverter;
import org.asciidoctor.log.Severity;

public class SeverityConverter extends EnumConverter<Severity> {

    public SeverityConverter() {
        super("--failure-level", Severity.class);
    }

    @Override
    public Severity convert(String argument) {
        return super.convert(argument.toUpperCase());
    }

}

Improve error messages when parsing --failure-level parameter