Lucien Cartier-Tilet fe6efa0b5c
Create basic CLI interface
As of now, it is possible to feed lang-evolve-cli a set of rules as a
file, as well as an input as a file too. A `--help` option is provided
as well through Clap.
2020-07-12 13:06:28 +02:00

22 lines
510 B
Rust

use std::fs::File;
use std::io::prelude::*;
use lang_evolve_core::settings::Settings;
mod opts;
use opts::Opts;
use clap::Clap;
fn main() {
lang_evolve_core::init().unwrap();
let opts: Opts = Opts::parse();
let settings = Settings::from(opts.settings).unwrap();
let mut input_file = File::open(opts.input).unwrap();
let mut input = String::new();
input_file.read_to_string(&mut input).unwrap();
println!("{:?}", settings);
println!("{}", settings.apply(input).unwrap());
}