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()); }

}

@@ -61,57 +61,32 @@
 der.
-IStringConverter;%0Aimport org.asciidoctor.SafeMode
+converters.EnumConverter
 ;%0Aim
@@ -156,26 +156,20 @@
 ter 
-implements IString
+extends Enum
 Conv
@@ -187,16 +187,106 @@
 ity%3E %7B%0A%0A
+    public SeverityConverter() %7B%0A        super(%22--failure-level%22, Severity.class);%0A    %7D%0A%0A
     @Ove
@@ -341,32 +341,37 @@
 t) %7B
- return Severity.valueOf
+%0A        return super.convert
 (arg
@@ -391,14 +391,18 @@
 Case());
+%0A   
  %7D%0A%0A%7D%0A

Improve error messages when parsing --failure-level parameter