31 lines
642 B
Rust
31 lines
642 B
Rust
use std::io;
|
|
use std::error::Error;
|
|
use std::time::Duration;
|
|
use clap::Parser;
|
|
mod app;
|
|
mod ui;
|
|
mod crossterm;
|
|
use crate::{
|
|
app::App,
|
|
ui::ui,
|
|
|
|
};
|
|
|
|
#[derive(Debug, Parser)]
|
|
struct Cli {
|
|
/// time in ms between two ticks.
|
|
#[arg(short, long, default_value_t = 200)]
|
|
tick_rate: u64,
|
|
|
|
/// whether unicode symbols are used to improve the overall look of the app
|
|
#[arg(short, long, default_value_t = true)]
|
|
unicode: bool,
|
|
}
|
|
|
|
fn main() -> Result<(), Box<dyn Error>> {
|
|
let cli = Cli::Parse();
|
|
let tick_rate = Duration::from_millis(cli.tick_rate);
|
|
crate::crossterm::run(tick_rate, cli.unicode)?;
|
|
Ok(())
|
|
}
|