aboutsummaryrefslogtreecommitdiff
path: root/cli/src/main.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-07-31 13:40:40 +0100
committerAleksey Kladov <[email protected]>2018-07-31 13:40:40 +0100
commit9ce7e8110254e8db476c96bce2eecb2d16983159 (patch)
treeabaddbafc4593948849394b430e3bde5c624fa22 /cli/src/main.rs
parent2a2815266b35de12bd3c48cc405e8b3e8fcf8885 (diff)
cleanups
Diffstat (limited to 'cli/src/main.rs')
-rw-r--r--cli/src/main.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/cli/src/main.rs b/cli/src/main.rs
index f87878137..546cbb66b 100644
--- a/cli/src/main.rs
+++ b/cli/src/main.rs
@@ -4,8 +4,8 @@ extern crate failure;
4extern crate libsyntax2; 4extern crate libsyntax2;
5extern crate tools; 5extern crate tools;
6 6
7use std::{fs, path::Path, io::Read};
8use clap::{App, Arg, SubCommand}; 7use clap::{App, Arg, SubCommand};
8use std::{fs, io::Read, path::Path};
9use tools::collect_tests; 9use tools::collect_tests;
10 10
11type Result<T> = ::std::result::Result<T, failure::Error>; 11type Result<T> = ::std::result::Result<T, failure::Error>;
@@ -15,8 +15,18 @@ fn main() -> Result<()> {
15 .setting(clap::AppSettings::SubcommandRequiredElseHelp) 15 .setting(clap::AppSettings::SubcommandRequiredElseHelp)
16 .subcommand( 16 .subcommand(
17 SubCommand::with_name("render-test") 17 SubCommand::with_name("render-test")
18 .arg(Arg::with_name("line").long("--line").required(true).takes_value(true)) 18 .arg(
19 .arg(Arg::with_name("file").long("--file").required(true).takes_value(true)) 19 Arg::with_name("line")
20 .long("--line")
21 .required(true)
22 .takes_value(true),
23 )
24 .arg(
25 Arg::with_name("file")
26 .long("--file")
27 .required(true)
28 .takes_value(true),
29 ),
20 ) 30 )
21 .subcommand(SubCommand::with_name("parse")) 31 .subcommand(SubCommand::with_name("parse"))
22 .get_matches(); 32 .get_matches();
@@ -24,7 +34,7 @@ fn main() -> Result<()> {
24 ("parse", _) => { 34 ("parse", _) => {
25 let tree = parse()?; 35 let tree = parse()?;
26 println!("{}", tree); 36 println!("{}", tree);
27 }, 37 }
28 ("render-test", Some(matches)) => { 38 ("render-test", Some(matches)) => {
29 let file = matches.value_of("file").unwrap(); 39 let file = matches.value_of("file").unwrap();
30 let file = Path::new(file); 40 let file = Path::new(file);
@@ -36,7 +46,6 @@ fn main() -> Result<()> {
36 _ => unreachable!(), 46 _ => unreachable!(),
37 } 47 }
38 Ok(()) 48 Ok(())
39
40} 49}
41 50
42fn parse() -> Result<String> { 51fn parse() -> Result<String> {