Skip to content

Commit 4c5f730

Browse files
committed
feat: dochia --version prints more meaninful info
1 parent faab98e commit 4c5f730

3 files changed

Lines changed: 37 additions & 6 deletions

File tree

src/main/java/dev/dochia/cli/core/util/DochiaModelUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dev.dochia.cli.core.util;
22

3+
import io.quarkus.runtime.annotations.RegisterForReflection;
34
import io.swagger.v3.oas.models.OpenAPI;
45
import io.swagger.v3.oas.models.media.ArraySchema;
56
import io.swagger.v3.oas.models.media.BinarySchema;
@@ -31,6 +32,7 @@
3132
* Wrapper on top of {@link org.openapitools.codegen.utils.ModelUtils} in order to accommodate
3233
* some particular conditions needed by dochia.
3334
*/
35+
@RegisterForReflection
3436
public abstract class DochiaModelUtils {
3537
public static final String X_DOCHIA_FIELD_NAME = "x-dochia-field-name";
3638
private static final Pattern GENERATED_PREFIX = Pattern.compile("generated_.*");

src/main/java/dev/dochia/cli/core/util/VersionProvider.java

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,44 @@
99
*/
1010
public class VersionProvider implements CommandLine.IVersionProvider {
1111

12+
private static final String LOGO = """
13+
888 888 d8b
14+
888 888 Y8P
15+
888 888
16+
.d88888 .d88b. .d8888b 88888b. 888 8888b.
17+
d88" 888 d88""88b d88P" 888 "88b 888 "88b
18+
888 888 888 888 888 888 888 888 .d888888
19+
Y88b 888 Y88..88P Y88b. 888 888 888 888 888
20+
"Y88888 "Y88P" "Y8888P 888 888 888 "Y888888
21+
22+
""";
23+
24+
private static final String DESCRIPTION = """
25+
26+
@|bold dochia|@ - bringing chaos with love!
27+
28+
@|bold,underline Because nobody wants to debug why their "enterprise-grade" API can't handle a simple 🤷‍♀️|@
29+
30+
dochia automatically generates and executes negative and boundary testing so you can
31+
focus on creative problem-solving. dochia lets you find bugs, security vulnerabilities,
32+
and contract violations in your API without writing a single test.
33+
34+
@|yellow GitHub:|@ https://github.com/dochia-dev/dochia-cli
35+
@|yellow Docs:|@ https://docs.dochia.dev
36+
""";
37+
1238
@Override
1339
public String[] getVersion() throws Exception {
1440
Properties properties = new Properties();
1541
properties.load(getClass().getClassLoader().getResourceAsStream("version.properties"));
42+
String version = properties.getProperty("app.version") + " (Free)";
43+
String buildTime = properties.getProperty("app.buildTime");
44+
1645
return new String[]{
17-
"%n@|green "
18-
+ properties.getProperty("app.name")
19-
+ " v"
20-
+ properties.getProperty("app.version")
21-
+ "|@ (Free)"
46+
LOGO,
47+
"@|bold,green " + properties.getProperty("app.name") + " version " + version + "|@",
48+
"@|faint Built on: " + buildTime + "|@",
49+
DESCRIPTION
2250
};
2351
}
2452
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
app.version=@project.version@
2-
app.name=@project.name@
2+
app.name=@project.name@
3+
app.buildTime=@timestamp@

0 commit comments

Comments
 (0)