https://projekte.kosit.org/kosit/validator/-/issues/93 (Fix) No usage information necessary when validation fails

This commit is contained in:
apenski 2022-11-09 08:27:01 +01:00
parent 0281d94929
commit 38ab54438c
3 changed files with 8 additions and 4 deletions

View file

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
# 1.5.0 (to be released) # 1.5.0 (to be released)
### Fixed
- [#93](https://projekte.kosit.org/kosit/validator/-/issues/93) Remove usage information, when validation failed (CLI)
### Added ### Added
- Support for multiple configurations and multiple repositories. See [cli documentation](docs/cli.md) for details - Support for multiple configurations and multiple repositories. See [cli documentation](docs/cli.md) for details
@ -18,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
removed. removed.
- Bump [Saxon HE](https://www.saxonica.com/documentation11/documentation.xml) to 11.4 - Bump [Saxon HE](https://www.saxonica.com/documentation11/documentation.xml) to 11.4
- Bump [jaxb-ri](https://github.com/eclipse-ee4j/jaxb-ri) to 2.3.7 - Bump [jaxb-ri](https://github.com/eclipse-ee4j/jaxb-ri) to 2.3.7
- [INTERNAL] CLI parsing based on pico-cli, commons-cli is removed - [INTERNAL] CLI parsing based on pico-cli, commons-cli is removed
## 1.4.2 ## 1.4.2

View file

@ -20,7 +20,6 @@ import static de.kosit.validationtool.impl.Printer.writeErr;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.fusesource.jansi.AnsiConsole; import org.fusesource.jansi.AnsiConsole;
import org.fusesource.jansi.AnsiConsole;
import org.fusesource.jansi.AnsiRenderer.Code; import org.fusesource.jansi.AnsiRenderer.Code;
import de.kosit.validationtool.cmd.report.Line; import de.kosit.validationtool.cmd.report.Line;
@ -84,8 +83,7 @@ public class CommandLineApplication {
resultStatus = ReturnValue.HELP_REQUEST; resultStatus = ReturnValue.HELP_REQUEST;
} else { } else {
resultStatus = ObjectUtils.defaultIfNull(commandLine.getExecutionResult(), ReturnValue.PARSING_ERROR); resultStatus = ObjectUtils.defaultIfNull(commandLine.getExecutionResult(), ReturnValue.PARSING_ERROR);
if (resultStatus.getCode() != ReturnValue.PARSING_ERROR.getCode() if (resultStatus.getCode() < 0) {
&& resultStatus.getCode() != ReturnValue.SUCCESS.getCode()) {
commandLine.usage(System.out); commandLine.usage(System.out);
} }
} }

View file

@ -20,7 +20,8 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
/** /**
* CLI return codes. * CLI return codes. Codes > 0 indicate a processing error. Codes < indicates a configuration error. Code 0 indicates a
* successful processing.
* *
* @author Andreas Penski * @author Andreas Penski
*/ */