Permalink
Browse files

Reindent with cargo fmt

  • Loading branch information...
radare committed May 26, 2016
1 parent 7795ba6 commit 171b9af9a0d146c2c01fee3b7f41db4dd22b6d83
Showing with 29 additions and 39 deletions.
  1. +2 −0 rustfmt.toml
  2. +12 −25 src/args.rs
  3. +5 −3 src/errors.rs
  4. +1 −2 src/main.rs
  5. +9 −9 src/structs.rs
View
@@ -1,3 +1,5 @@
format_strings = true
reorder_imports = true
take_source_hints = false
max_width = 100
ideal_width = 78
View
@@ -11,36 +11,23 @@ static USAGE: &'static str = "
radeco. The radare2 decompiler.
Usage:
radeco <file>
radeco \
[options] [<file>]
radeco [options] [<file>]
radeco run [options] [<file>]
Options:
\
--config <json_file> Run decompilation using json rules file.
\
--make-config <file> Wizard to make the JSON config.
-a \
--address=<addr> Address of function to decompile.
-e \
--esil=<esil_expr> Evaluate given esil expression.
-o \
--output=<output> Specify output directory.
-p \
--pipeline=<pipe> Stages in the pipeline. Comma separated \
values.
Prefix the string with '=' (such \
as =ssa)
--config <json_file> Run decompilation using json rules file.
--make-config <file> Wizard to make the JSON config.
-a --address=<addr> Address of function to decompile.
-e --esil=<esil_expr> Evaluate given esil expression.
-o --output=<output> Specify output directory.
-p --pipeline=<pipe> Stages in the pipeline. Comma separated values.
Prefix the string with '=' (such as =ssa)
to obtain the output the stage.
\
Valid values: c,r2,ssa,cfg,const,dce,verify,svg,png
-q --quiet \
Display silent output.
-s --shell Run interactive \
prompt.
Valid values: c,r2,ssa,cfg,const,dce,verify,svg,png
-q --quiet Display silent output.
-s --shell Run interactive prompt.
-v --version Show version.
-h --help \
Show this screen.
-h --help Show this screen.
";
#[derive(Debug, RustcDecodable)]
View
@@ -19,9 +19,11 @@ impl fmt::Display for ArgError {
ArgError::IoError(ref err) => write!(f, "{}", err),
ArgError::DecodeError(ref err) => write!(f, "{}", err),
ArgError::InvalidArgument(ref err) => write!(f, "Invalid Argument: {}", err),
ArgError::NoSource => write!(f,
"{}",
"No source to run on. Please input binary or raw esil"),
ArgError::NoSource => {
write!(f,
"{}",
"No source to run on. Please input binary or raw esil")
}
ArgError::MultipleSources => write!(f, "{}", "Cannot run radeco on multiple sources"),
ArgError::MissingArgument(ref err) => write!(f, "Missing Argument: {}", err),
ArgError::InvalidSource(ref err) => write!(f, "{}", err),
View
@@ -17,8 +17,7 @@ mod logger;
use std::process::exit;
#[cfg(not(feature = "trace_log"))]
fn init_logger() {
}
fn init_logger() {}
#[cfg(feature = "trace_log")]
fn init_logger() {
logger::RadecoLog::init().ok();
View
@@ -161,7 +161,7 @@ impl Input {
let addr = if self.addr.is_some() {
if bin.is_none() {
return Err(ArgError::InvalidArgument("Address provided without source binary"
.to_owned()));
.to_owned()));
}
self.addr.clone()
} else {
@@ -282,14 +282,14 @@ pub fn input_builder() -> Input {
println!("Quiet (y/N):");
let _v = read!();
_v.or(Some("n".to_owned()))
.map(|c| {
match &*c {
"y" => true,
"n" => false,
_ => false,
}
})
.unwrap()
.map(|c| {
match &*c {
"y" => true,
"n" => false,
_ => false,
}
})
.unwrap()
};
let outmodes = Some((0..(pipe.len() - 1) as u16).collect::<Vec<_>>());

0 comments on commit 171b9af

Please sign in to comment.