kittv
/
prezgen
Archived
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

40 lines
822 B
Rust

use structopt::StructOpt;
use toml::Value;
use std::path::PathBuf;
use std::fs::{read_to_string, copy};
#[derive(StructOpt, Debug)]
/// structure representing command line arguments
struct Opt {
#[structopt(name = "FILE")]
/// The input file.
/// It contains all the settings related to substitution
toml: PathBuf,
#[structopt(short, long, default_value = "output")]
/// Output directory.
output: PathBuf,
#[structopt(short, long)]
/// Template to be processed.
/// if a directory, then all the unspecified
/// files will be copied to the output as well.
template: PathBuf,
}
fn main() {
// parse command line arguments
let opt = Opt::from_args();
//println!("{:?}", opt);
// parse toml
let value = read_to_string(opt.toml)
.unwrap()
.parse::<Value>()
.unwrap();
println!("{:?}", value);
}