-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error messages when parsing --failure-level parameter
- Loading branch information
1 parent
ca28b28
commit 4d5128e
Showing
1 changed file
with
9 additions
and
4 deletions.
There are no files selected for viewing
13 changes: 9 additions & 4 deletions
13
asciidoctorj-core/src/main/java/org/asciidoctor/jruby/cli/SeverityConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
package org.asciidoctor.jruby.cli; | ||
|
||
import com.beust.jcommander.IStringConverter; | ||
import org.asciidoctor.SafeMode; | ||
import com.beust.jcommander.converters.EnumConverter; | ||
import org.asciidoctor.log.Severity; | ||
|
||
public class SeverityConverter implements IStringConverter<Severity> { | ||
public class SeverityConverter extends EnumConverter<Severity> { | ||
|
||
public SeverityConverter() { | ||
super("--failure-level", Severity.class); | ||
} | ||
|
||
@Override | ||
public Severity convert(String argument) { return Severity.valueOf(argument.toUpperCase()); } | ||
public Severity convert(String argument) { | ||
return super.convert(argument.toUpperCase()); | ||
} | ||
|
||
} |