diff --git a/src/main.rs b/src/main.rs index 447b1d8..0e31854 100644 --- a/src/main.rs +++ b/src/main.rs @@ -57,19 +57,19 @@ impl rest_api::DataProvider for PulseDataProvider { fn main() { let cli_args = clap_app!(s0_meter => (version: APP_VERSION) - (author: "Harald Kube ") (about: "Listen for S0 pulses at the given GPIO pins") - (@arg v: -v ... "Set the verbosity level (up to -vvv)") + // (@arg v: -v ... "Set the verbosity level (up to -vvv)") (@arg config: -c --config +takes_value "The name of the config file (default: /etc/s0_logger.cfg)") ).get_matches(); - let log_level = cli_args.occurrences_of("v"); - match log_level { - 0 => println!("No logging"), - 1 => println!("A little logging"), - 2 => println!("A little more logging"), - _ => println!("A lot logging"), - }; + // let log_level = cli_args.occurrences_of("v"); + // match log_level { + // 0 => println!("No logging"), + // 1 => println!("A little logging"), + // 2 => println!("A little more logging"), + // _ => println!("A lot logging"), + // }; let config_file_name = cli_args .value_of("config") @@ -91,10 +91,11 @@ fn main() { } Err(err_msg) => { // TODO Log - panic!( + println!( "Error while parsing config file {}: {}", config_file_name, err_msg ); + std::process::exit(1); } };