JFortschritt

JFortschritt is a small library for writing progress bars to the command-line.

License

License

GroupId

GroupId

com.github.stefanbirkner
ArtifactId

ArtifactId

jfortschritt
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

JFortschritt
JFortschritt is a small library for writing progress bars to the command-line.
Project URL

Project URL

https://github.com/stefanbirkner/jfortschritt
Source Code Management

Source Code Management

https://github.com/stefanbirkner/jfortschritt/

Download jfortschritt

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.stefanbirkner/jfortschritt/ -->
<dependency>
    <groupId>com.github.stefanbirkner</groupId>
    <artifactId>jfortschritt</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.stefanbirkner/jfortschritt/
implementation 'com.github.stefanbirkner:jfortschritt:0.2.0'
// https://jarcasting.com/artifacts/com.github.stefanbirkner/jfortschritt/
implementation ("com.github.stefanbirkner:jfortschritt:0.2.0")
'com.github.stefanbirkner:jfortschritt:jar:0.2.0'
<dependency org="com.github.stefanbirkner" name="jfortschritt" rev="0.2.0">
  <artifact name="jfortschritt" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.stefanbirkner', module='jfortschritt', version='0.2.0')
)
libraryDependencies += "com.github.stefanbirkner" % "jfortschritt" % "0.2.0"
[com.github.stefanbirkner/jfortschritt "0.2.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

JFortschritt

Build Status

JFortschritt is a small library for writing progress bars to the command-line.

JFortschritt is published under the MIT license. It needs Java 7, because this is the version that is supported by most applications that I encounter. Please let me know if you need JFortschritt to support an older version of Java.

Installation

JFortschritt is available from Maven Central.

<dependency>
  <groupId>com.github.stefanbirkner</groupId>
  <artifactId>jfortschritt</artifactId>
  <version>0.2.0</version>
</dependency>

Usage

Currently the library provides a single class: the ProgressLine. First create a new progress line.

import com.github.stefanbirkner.jfortschritt.*;

...

ProgressLine progressLine = new ProgressLine();

Start the progress line with the number of steps that are needed for completion:

progressLine.startWithNumberOfSteps(42);

It immediately prints an empty progress bar and a counter:

[>                                                                     ]

The width of the line is always 72 chars. Now move the progress line forward.

progressLine.moveForward();

and see the result

[==>                                                                   ]

This is how a progress line looks at the end. (It renders a new line character, too. Thus additional text starts at a new line.)

[=====================================================================>]

You may add additional parts to the progress line. E.g. JFortschritt provides a counter and a part with the estimated time, but you can build your own parts by implementing the interface ProgressLinePart.

ProgressLine progressLine = new ProgressLine(
    new Counter(), new EstimatedTime());

This is how a progress line looks with the additional parts.

[==>                                                    ] (1/42) eta 10s

Contributing

You have three options if you have a feature request, found a bug or simply have a question about JFortschritt.

Development Guide

JFortschritt is build with Maven. If you want to contribute code than

  • Please write a test for your change.
  • Ensure that you didn't break the build by running mvn test.
  • Fork the repo and create a pull request. (See Understanding the GitHub Flow)

The basic coding style is described in the EditorConfig file .editorconfig.

JFortschritt supports Travis CI for continuous integration. Your pull request will be automatically build by Travis CI.

Release Guide

  • Select a new version according to the Semantic Versioning 2.0.0 Standard.
  • Set the new version in pom.xml and in the Installation section of this readme.
  • Commit the modified pom.xml and README.md.
  • Run mvn clean deploy with JDK 7.
  • Add a tag for the release: git tag jfortschritt-X.X.X

Versions

Version
0.2.0
0.1.0