use aesthetics;
use argument::Argument;
use std::string::String;
use std::{
thread,
time,
};
use str_util;
pub fn help(usage: &'static str, arg_array: Vec<Argument>) {
let cli = aesthetics::CLI::new();
let duration = time::Duration::from_millis(25);
let mut help: Vec<String> = Vec::new();
help.push(format!("{}{}", cli.border_horizontal('-', 1_f32), str_util::newline(),));
help.push(format!(
"{}{}{}",
String::from("Usage:\n "),
String::from(usage),
str_util::newline(),
));
help.push(String::from("Flags:"));
for argument in arg_array {
help.push(format!(" -{} # {}", argument.identifier().to_string(), argument.description()));
}
help.push(str_util::newline());
for line in &help {
println!("{}", &line);
thread::sleep(duration);
}
}