2023-03-31 17:36:31 -05:00
|
|
|
use std::env;
|
|
|
|
use std::fs;
|
|
|
|
|
|
|
|
use segdense::error::SegDenseError;
|
|
|
|
use segdense::util;
|
|
|
|
|
|
|
|
fn main() -> Result<(), SegDenseError> {
|
2023-04-05 16:08:19 -07:00
|
|
|
env_logger::init();
|
|
|
|
let args: Vec<String> = env::args().collect();
|
2023-03-31 17:36:31 -05:00
|
|
|
|
2023-04-05 16:08:19 -07:00
|
|
|
let schema_file_name: &str = if args.len() == 1 {
|
|
|
|
"json/compact.json"
|
|
|
|
} else {
|
|
|
|
&args[1]
|
|
|
|
};
|
2023-03-31 17:36:31 -05:00
|
|
|
|
2023-04-05 16:08:19 -07:00
|
|
|
let json_str = fs::read_to_string(schema_file_name)?;
|
2023-03-31 17:36:31 -05:00
|
|
|
|
2023-04-05 16:08:19 -07:00
|
|
|
util::safe_load_config(&json_str)?;
|
2023-03-31 17:36:31 -05:00
|
|
|
|
2023-04-05 16:08:19 -07:00
|
|
|
Ok(())
|
|
|
|
}
|