diff options
| author | Philipp A | 2018-12-08 00:50:43 +0100 | 
|---|---|---|
| committer | Philipp A | 2018-12-08 00:50:43 +0100 | 
| commit | f3dffc65ef4a6d163f6bdfae468bd7f57894ee3f (patch) | |
| tree | ad282c00f311f8a02260d6bca159c45f24c9c9d3 /src/bin.rs | |
| parent | 96b5685ef6e74d2be4f43b96e3862abdfc0fcb0d (diff) | |
| download | rust-rst-f3dffc65ef4a6d163f6bdfae468bd7f57894ee3f.tar.bz2 | |
quicli 0.4
Diffstat (limited to 'src/bin.rs')
| -rw-r--r-- | src/bin.rs | 13 | 
1 files changed, 10 insertions, 3 deletions
| @@ -7,7 +7,10 @@ pub mod target;  use structopt::StructOpt;  use clap::{_clap_count_exprs, arg_enum}; -use quicli::{main, fs::read_file, prelude::Verbosity}; +use quicli::{ +    fs::read_file, +    prelude::{CliResult,Verbosity}, +};  use self::parser::{      serialize_json, @@ -32,11 +35,15 @@ struct Cli {      verbosity: Verbosity,  } -main!(|args: Cli, log_level: verbosity| { +fn main() -> CliResult { +    let args = Cli::from_args(); +    args.verbosity.setup_env_logger("rst")?; +          let content = read_file(args.file)?;      let stdout = std::io::stdout();      match args.format {          Format::json => serialize_json(&content, stdout)?,          Format::xml  => serialize_xml (&content, stdout)?,      } -}); +    Ok(()) +} | 
