1 extern crate flowgger;
2 
3 use clap::{App, Arg};
4 use std::io::{stderr, Write};
5 
6 const DEFAULT_CONFIG_FILE: &str = "flowgger.toml";
7 const FLOWGGER_VERSION_STRING: &str = env!("CARGO_PKG_VERSION");
8 
main()9 fn main() {
10     let matches = App::new("Flowgger")
11         .version(FLOWGGER_VERSION_STRING)
12         .about("A fast, simple and lightweight data collector")
13         .arg(
14             Arg::with_name("config_file")
15                 .help("Configuration file")
16                 .value_name("FILE")
17                 .index(1),
18         )
19         .get_matches();
20     let config_file = matches
21         .value_of("config_file")
22         .unwrap_or(DEFAULT_CONFIG_FILE);
23     let _ = writeln!(stderr(), "Flowgger {}", FLOWGGER_VERSION_STRING);
24     flowgger::start(config_file)
25 }
26