Skip to content

Commit

Permalink
improve version string
Browse files Browse the repository at this point in the history
  • Loading branch information
esaulpaugh committed Jan 10, 2024
1 parent b59bc18 commit 75d23ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ compileJava {
if (Jvm.current().getJavaVersion() > JavaVersion.VERSION_1_8) {
options.compilerArgs.addAll(['--release', '8'])
}
options.encoding = "UTF-8"
}

repositories {
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/com/esaulpaugh/headlong/cli/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,20 +370,22 @@ private static String completeNameString(StringBuilder sb) {
}

private static String makeVersionString(String buildDate, String headlongVersion) {


final String graphic =
" | | | |\n" +
" |_ = _ _| | _ _ _ _ | `\n" +
" | | |_ |_|_ |_| | |_| | | |_| -- |_ | |\n";
" ┌─┐ │ │ \n" +
" ├─┐ ├─┘┌─┐ ┌─┤ │ ┌─┐ ┌─┐ ┌─┐ ┌─ │ `\n" +
" │ │ └─ └─┘─ └─┘ │ └─┘ │ │ └─┤ ── └─ │ │\n";
String versionLine = "version " + Main.class.getPackage().getImplementationVersion();
final int padding = 28 - versionLine.length();
if(padding > 0) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < padding; i++) {
sb.append(' ');
}
versionLine += sb.append("_|");
versionLine += sb.append("─┘");
} else {
versionLine = " _|\n" + versionLine;
versionLine = " ─┘\n" + versionLine;
}
return graphic
+ versionLine
Expand Down

0 comments on commit 75d23ab

Please sign in to comment.