riplog-view/backend/main.rs

35 lines
881 B
Rust
Raw Normal View History

2020-01-24 15:16:42 +00:00
mod database;
mod graphql;
use clap::{App, Arg};
use database::scan_dbs;
use graphql::server;
fn main() -> std::io::Result<()> {
let cmd = App::new("Riplog")
.version("1.0")
.arg(
Arg::with_name("basedir")
.required(true)
.short("d")
.help("Base directory containing ripcord db files")
.default_value(".")
.index(1),
)
.arg(
Arg::with_name("bind")
.required(true)
.short("b")
.help("Address to bind to")
.default_value("127.0.0.1:9743")
.index(2),
)
.get_matches();
let basedir = cmd.value_of("basedir").unwrap();
let logs = scan_dbs(basedir);
println!("Loaded data for {} workspaces", logs.len());
server(logs);
Ok(())
}