diff options
author | Aleksey Kladov <[email protected]> | 2018-07-31 13:40:40 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-07-31 13:40:40 +0100 |
commit | 9ce7e8110254e8db476c96bce2eecb2d16983159 (patch) | |
tree | abaddbafc4593948849394b430e3bde5c624fa22 /cli/src | |
parent | 2a2815266b35de12bd3c48cc405e8b3e8fcf8885 (diff) |
cleanups
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/main.rs | 19 |
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; | |||
4 | extern crate libsyntax2; | 4 | extern crate libsyntax2; |
5 | extern crate tools; | 5 | extern crate tools; |
6 | 6 | ||
7 | use std::{fs, path::Path, io::Read}; | ||
8 | use clap::{App, Arg, SubCommand}; | 7 | use clap::{App, Arg, SubCommand}; |
8 | use std::{fs, io::Read, path::Path}; | ||
9 | use tools::collect_tests; | 9 | use tools::collect_tests; |
10 | 10 | ||
11 | type Result<T> = ::std::result::Result<T, failure::Error>; | 11 | type 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 | ||
42 | fn parse() -> Result<String> { | 51 | fn parse() -> Result<String> { |