You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you call the program below it finishes with the bar at 0%. Compile the code below and run it
extern crate argparse;
extern crate rustbar;
use argparse::{ArgumentParser, List};
use rustbar::rustbars::{ProgressBar, PercentageProgressBar};
use std::thread::sleep_ms;
fn main() {
let task;
let mut tasks_vector: Vec<String> = Vec::new();
{
let mut parser = ArgumentParser::new();
parser.set_description("A CLI tool to do Pomodoro tasks");
parser.refer(&mut tasks_vector)
.add_argument("task", List,
"Task that you want to do");
parser.parse_args_or_exit();
}
task = tasks_vector.join(" ");
let mut progress = PercentageProgressBar::new();
for idx in 1..25 {
progress.set_value((idx/25)*100);
progress.set_msg(&task[..]);
progress.render();
sleep_ms(1000);
}
}
once run it looks like
dburns in ~/development/learn on master ● λ target/debug/./learn task task
task task0%% dburns in ~/development/learn on master ● λ
The text was updated successfully, but these errors were encountered:
If you call the program below it finishes with the bar at 0%. Compile the code below and run it
once run it looks like
The text was updated successfully, but these errors were encountered: