Progressbar in V based on progressbar by Trevor Fountain and Johannes Buchner.
progressbar is for displaying attractive progress bars on the command line. It's heavily influenced by the ruby ProgressBar gem, whose api and behaviour it imitates. Really want something like tqdm. But this was simpler. It waits until 0.5% is done to try and calculate the remaining time. It then might quit if over 99 days, 59 min, 59 secs.
Example usage:
import time
import progressbar as prog
fn main() {
mut p := prog.progressbar_new("Testing", 100) or { panic('Something went wrong with progressbar_new')}
for i := 0; i < 100; i++ {
// Simulating doing some stuff
time.sleep(1 * time.second)
p.progressbar_inc()
}
p.progressbar_finish()
}Eventually, I will put this in vpm but for now:
v install https://github.com/mecolosimo/progressbar.git