GithubHelp home page GithubHelp logo

jfortschritt's Introduction

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

jfortschritt's People

Contributors

stefanbirkner avatar

Stargazers

Twaldigas avatar Bernd Ahlers avatar Narendra Pathai avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.