1
0
Fork 0

Use path clarity

This commit is contained in:
Daniele Tricoli 2018-12-07 01:00:20 +01:00
parent 91f4d49a47
commit dc9bf793bb
3 changed files with 10 additions and 12 deletions

View File

@ -5,20 +5,14 @@
#[macro_use]
extern crate pest_derive;
#[macro_use]
extern crate clap;
extern crate colored;
extern crate indexmap;
extern crate pest;
pub mod parsers;
mod parsers;
use std::collections::BTreeMap;
use std::fs;
use std::process;
use clap::{App, Arg};
use clap::{crate_version, App, Arg};
use colored::Colorize;
use crate::parsers::slice;
@ -39,7 +33,8 @@ fn main() {
.short("c")
.takes_value(true)
.value_name("FILE"),
).arg(
)
.arg(
Arg::with_name("profile")
.help("The profile used to fill the template")
.long("profile")
@ -47,7 +42,8 @@ fn main() {
.short("p")
.takes_value(true)
.value_name("FILE"),
).get_matches();
)
.get_matches();
// We can unwrap because config is required.
let config_file = matches.value_of("config").unwrap();

View File

@ -65,7 +65,8 @@ fn parse_from_string() {
let conf = "
Author.name = eriol
Author.like = rust, python
".to_string();
"
.to_string();
let c = parse(&conf).unwrap();
@ -79,7 +80,8 @@ fn update() {
Author.name = eriol
Author.like = rust, python
Author.web = example.org
".to_string();
"
.to_string();
let mut m = BTreeMap::new();
m.insert("Author.like".to_string(), "rust, python, c++".to_string());