diff options
| author | Philipp A | 2019-03-31 23:21:45 +0200 |
|---|---|---|
| committer | Philipp A | 2019-03-31 23:21:45 +0200 |
| commit | 4e22848e3faa255c34fdc1b6503a88a02a7350c5 (patch) | |
| tree | d6875de0087de8ab01263fb4f93a6f4457caafd1 /src/bin.rs | |
| parent | 33f1186bfb5deb0db5ae29d26daf18dbe38fd21a (diff) | |
| download | rust-rst-4e22848e3faa255c34fdc1b6503a88a02a7350c5.tar.bz2 | |
Convert indentation to tabs
Diffstat (limited to 'src/bin.rs')
| -rw-r--r-- | src/bin.rs | 56 |
1 files changed, 28 insertions, 28 deletions
@@ -9,47 +9,47 @@ pub mod target; use structopt::StructOpt; use clap::{_clap_count_exprs, arg_enum}; use quicli::{ - fs::read_file, - prelude::{CliResult,Verbosity}, + fs::read_file, + prelude::{CliResult,Verbosity}, }; use self::parser::parse; use self::renderer::{ - render_json, - render_xml, - render_html, + render_json, + render_xml, + render_html, }; arg_enum! { - #[derive(Debug)] - #[allow(non_camel_case_types)] - enum Format { json, xml, html } + #[derive(Debug)] + #[allow(non_camel_case_types)] + enum Format { json, xml, html } } #[derive(Debug, StructOpt)] #[structopt(raw(setting = "structopt::clap::AppSettings::ColoredHelp"))] struct Cli { - #[structopt( - long = "format", short = "f", default_value = "html", // xml is pretty defunct… - raw(possible_values = "&Format::variants()", case_insensitive = "true"), - )] - format: Format, - file: String, - #[structopt(flatten)] - verbosity: Verbosity, + #[structopt( + long = "format", short = "f", default_value = "html", // xml is pretty defunct… + raw(possible_values = "&Format::variants()", case_insensitive = "true"), + )] + format: Format, + file: String, + #[structopt(flatten)] + verbosity: Verbosity, } fn main() -> CliResult { - let args = Cli::from_args(); - args.verbosity.setup_env_logger("rst")?; - - let content = read_file(args.file)?; - let document = parse(&content)?; - let stdout = std::io::stdout(); - match args.format { - Format::json => render_json(&document, stdout)?, - Format::xml => render_xml (&document, stdout)?, - Format::html => render_html(&document, stdout)?, - } - Ok(()) + let args = Cli::from_args(); + args.verbosity.setup_env_logger("rst")?; + + let content = read_file(args.file)?; + let document = parse(&content)?; + let stdout = std::io::stdout(); + match args.format { + Format::json => render_json(&document, stdout)?, + Format::xml => render_xml (&document, stdout)?, + Format::html => render_html(&document, stdout)?, + } + Ok(()) } |
