Skip to content

C library for displaying progress bars on the command line.

License

Notifications You must be signed in to change notification settings

limix/progressbar

 
 

Repository files navigation

ProgressBar

Release Linux / macOS build Windows build

ProgressBar is a C library for displaying attractive progress bars on the command line. It's heavily influenced by the ruby ProgressBar gem, whose api and behaviour it imitates.

Usage

#include "progressbar.h"

int main()
{
  progressbar *progress = progressbar_new("Loading", 100);

  for(int i=0; i < 100; i++)
  {
    // Do some stuff
    progressbar_inc(progress);
  }

  progressbar_finish(progress);

  return 0;
}

Example output from test/demo.c:

demo output

Install

Conda package manager

We provide a conda distribution of progressbar under conda-forge channel:

conda install -c conda-forge c-progressbar

Building yourself

On Linux or macOS systems it can be as simple as

bash <(curl -fsSL https://raw.githubusercontent.com/limix/progressbar/master/install)

assuming that you have ncurses library installed and that cmake managed to find it.

On Windows systems you might want to have a look at the msys2 project first. It provides Unix-like environment making it easier to install, use, build and port software on Windows. In particular, it can be used to install gcc, ncurses, and cmake:

pacman -S --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-ncurses ^
                   mingw-w64-x86_64-cmake

Now from progressbar source directory, proceed with

mkdir build
cd build
cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release --target install

Problems

If you encounter any issue, please, submit it. Suggestions and ideas are also welcome.

Acknowledgements

License

This project is licensed under the MIT License - see the LICENSE file for details

Packages

No packages published

Languages

  • C 36.5%
  • C++ 24.2%
  • CMake 22.1%
  • Batchfile 10.9%
  • Shell 6.3%