Skip to content

Commit 4dab386

Browse files
committed
Merge branch 'develop'
2 parents bd9eeaf + 3282578 commit 4dab386

File tree

3 files changed

+65
-3
lines changed

3 files changed

+65
-3
lines changed

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,68 @@
1+
![GitHub forks](https://img.shields.io/github/forks/UnterrainerInformatik/java-cli-utils?style=social) ![GitHub stars](https://img.shields.io/github/stars/UnterrainerInformatik/java-cli-utils?style=social) ![GitHub repo size](https://img.shields.io/github/repo-size/UnterrainerInformatik/java-cli-utils) [![GitHub issues](https://img.shields.io/github/issues/UnterrainerInformatik/java-cli-utils)](https://github.com/UnterrainerInformatik/java-cli-utils/issues)
2+
3+
[![license](https://img.shields.io/github/license/unterrainerinformatik/FiniteStateMachine.svg?maxAge=2592000)](http://unlicense.org) [![Travis-build](https://travis-ci.org/UnterrainerInformatik/java-cli-utils.svg?branch=master)](https://travis-ci.org/github/UnterrainerInformatik/java-cli-utils) [![Maven Central](https://img.shields.io/maven-central/v/info.unterrainer.commons/cli-utils)](https://search.maven.org/artifact/info.unterrainer.commons/cli-utils) [![Twitter Follow](https://img.shields.io/twitter/follow/throbax.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/throbax)
4+
5+
6+
17
# java-cli-utils
28
A collection of useful tools if you want to make a command line interface of some sorts.
39

10+
## Console-Progressbar
11+
12+
The console-progressbar is designed to show progress when writing long-running console-applications.
13+
It was designed to be used with consoles that support control-characters (like cmd) or that don't (Eclipse console implementation before Mars (4.5)).
14+
15+
It comes with three flavors:
16+
17+
#### SimpleInsertBar
18+
19+
Works with non-control-character enabled consoles.
20+
Uses a completely new line for adding progress-characters instead.
21+
22+
```java
23+
prefix: [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]
24+
##################################################
25+
```
26+
27+
#### ProgressBar
28+
29+
Your ASCII-progressbar.
30+
Uses the same line, requiring ASCII escape characters.
31+
32+
```java
33+
prefix: [########------------------------------------------]
34+
```
35+
36+
#### PercentGauge
37+
38+
Displays the percentage.
39+
Needs ASCII escape characters as well.
40+
41+
```java
42+
prefix: [ 72%]
43+
```
44+
45+
46+
47+
You may extend the visual representations by implementing new graphical variants.
48+
49+
### Example
50+
51+
```java
52+
ConsoleProgressBar bar = ConsoleProgressBar.builder().maxValue((double)list.size()).
53+
controlCharacterSupport(!isForFileOut).build();
54+
55+
int count = 0;
56+
for (String s : list) {
57+
doSomething(s);
58+
59+
bar.updateValue(++count).redraw(System.out);
60+
}
61+
62+
bar.complete().redraw(System.out);
63+
System.out.println("\n");
64+
```
65+
466
## CliParser
567

668
This is a fluent wrapper over the Apache Commons CLI library.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<modelVersion>4.0.0</modelVersion>
1212
<artifactId>cli-utils</artifactId>
13-
<version>0.2.6</version>
13+
<version>0.2.7</version>
1414
<name>CliUtils</name>
1515
<packaging>jar</packaging>
1616

src/main/java/info/unterrainer/commons/parentpom/Information.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
public class Information {
44
public static final String name = "Parent-POM";
5-
public static final String buildTime = "2020-12-13T21:48:13Z";
6-
public static final String pomVersion = "0.2.6";
5+
public static final String buildTime = "2020-12-29T15:08:05Z";
6+
public static final String pomVersion = "0.2.7";
77
}

0 commit comments

Comments
 (0)