aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@cardoe.com>2019-12-25 14:25:37 -0600
committerDoug Goldstein <cardoe@cardoe.com>2020-01-26 09:20:18 -0600
commiteca92cad0b67141feb127192262fe22e77e1347e (patch)
treee650277895a4a2739b2142db912f843fbb35a560 /src
parentconvert from Cargo package data to cargo_metadata (diff)
downloadcargo-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.rs5
-rw-r--r--src/main.rs17
2 files changed, 3 insertions, 19 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 6a112bd..bb296e7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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);
}
}