diff options
author | Doug Goldstein <cardoe@cardoe.com> | 2019-12-25 14:25:37 -0600 |
---|---|---|
committer | Doug Goldstein <cardoe@cardoe.com> | 2020-01-26 09:20:18 -0600 |
commit | eca92cad0b67141feb127192262fe22e77e1347e (patch) | |
tree | e650277895a4a2739b2142db912f843fbb35a560 /src | |
parent | convert from Cargo package data to cargo_metadata (diff) | |
download | cargo-ebuild-eca92cad0b67141feb127192262fe22e77e1347e.tar.gz cargo-ebuild-eca92cad0b67141feb127192262fe22e77e1347e.tar.bz2 cargo-ebuild-eca92cad0b67141feb127192262fe22e77e1347e.zip |
drop Cargo usage
Converted Cargo usage to cargo_metadata so now drop out the last usage
which was marshalling the error to the user.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 5 | ||||
-rw-r--r-- | src/main.rs | 17 |
2 files changed, 3 insertions, 19 deletions
@@ -8,9 +8,6 @@ * except according to those terms. */ -extern crate cargo; -extern crate time; - mod metadata; use failure::format_err; @@ -30,7 +27,7 @@ fn parse_license<'a>(lic_str: &'a str) -> Vec<&'a str> { .collect() } -pub fn run(verbose: u32, quiet: bool, manifest_path: Option<PathBuf>) -> CliResult { +pub fn run(verbose: u32, quiet: bool, manifest_path: Option<PathBuf>) -> Result<(), failure::Error> { let mut cmd = cargo_metadata::MetadataCommand::new(); if let Some(path) = manifest_path { diff --git a/src/main.rs b/src/main.rs index 7999b8e..cca4d4a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,14 +8,11 @@ * except according to those terms. */ -extern crate cargo; extern crate cargo_ebuild; extern crate structopt; -use cargo::util::CliError; use cargo_ebuild::run; use std::path::PathBuf; -use std::process; use structopt::clap::AppSettings; use structopt::StructOpt; @@ -52,17 +49,7 @@ fn main() { // run the actual code if let Err(e) = run(opt.verbose as u32, opt.quiet, opt.manifest_path) { - // break apart the error - let CliError { - error, - exit_code, - unknown: _unknown, - } = e; - // display a msg if we got one - if let Some(msg) = error { - eprintln!("{}", msg); - } - // exit appropriately - process::exit(exit_code); + eprintln!("{}", e); + ::std::process::exit(1); } } |