diff options
author | 2017-04-16 09:10:51 -0500 | |
---|---|---|
committer | 2017-04-17 09:08:48 -0500 | |
commit | 5983b065aa2d3e27af68e150a0536e793dae13cf (patch) | |
tree | 46017e0f0bd3697a0e118853a320244c04497a18 | |
parent | move usage into its own variable (diff) | |
download | cargo-ebuild-5983b065aa2d3e27af68e150a0536e793dae13cf.tar.gz cargo-ebuild-5983b065aa2d3e27af68e150a0536e793dae13cf.tar.bz2 cargo-ebuild-5983b065aa2d3e27af68e150a0536e793dae13cf.zip |
upgrade to Cargo 0.17
-rw-r--r-- | Cargo.lock | 19 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/main.rs | 12 |
3 files changed, 23 insertions, 10 deletions
@@ -2,7 +2,7 @@ name = "cargo-ebuild" version = "0.1.3" dependencies = [ - "cargo 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cargo 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -36,11 +36,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cargo" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crates-io 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crates-io 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 0.6.86 (registry+https://github.com/rust-lang/crates.io-index)", @@ -62,6 +62,7 @@ dependencies = [ "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "shell-escape 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "tar 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -85,7 +86,7 @@ dependencies = [ [[package]] name = "crates-io" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -438,6 +439,11 @@ dependencies = [ ] [[package]] +name = "shell-escape" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "strsim" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -564,10 +570,10 @@ dependencies = [ "checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" "checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" -"checksum cargo 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5bf5313c834cd8519dad3e3ed603a9bab71c1caf10cc3f4a9f9db576bc447a16" +"checksum cargo 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d743b5e0ae7ef24e1053780bce3dc5ac47a923dfafe5759244980607716571a" "checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" "checksum cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "d18d68987ed4c516dcc3e7913659bfa4076f5182eea4a7e0038bb060953e76ac" -"checksum crates-io 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1739d2ca574588a526454009739f0f188ebe2df2db27c4669e3c3f252b0a962c" +"checksum crates-io 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "14982f07738e88d42b575b67b8a902da50473efdcb30b9c43a27e08f399a1943" "checksum crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5ea215664ca264da8a9d9c3be80d2eaf30923c259d03e870388eb927508f97" "checksum curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c90e1240ef340dd4027ade439e5c7c2064dd9dc652682117bd50d1486a3add7b" "checksum curl-sys 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d909dc402ae80b6f7b0118c039203436061b9d9a3ca5d2c2546d93e0a61aaa" @@ -608,6 +614,7 @@ dependencies = [ "checksum rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "684ce48436d6465300c9ea783b6b14c4361d6b8dcbb1375b486a69cc19e2dfb0" "checksum semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae2ff60ecdb19c255841c066cbfa5f8c2a4ada1eb3ae47c77ab6667128da71f5" "checksum semver-parser 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fff3c9c5a54636ab95acd8c1349926e04cb1eb8cd70b5adced8a1d1f703a67" +"checksum shell-escape 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "dd5cc96481d54583947bfe88bf30c23d53f883c6cd0145368b69989d97b84ef8" "checksum strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "67f84c44fbb2f91db7fef94554e6b2ac05909c9c0b0bc23bb98d3a1aebfe7f7c" "checksum tar 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c2374f318bbe2c5ac6c83dd6240d5f1a73106f72d39b3f7d6f8d8637c7b425d8" "checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" @@ -17,6 +17,6 @@ Generates an ebuild for a package using the in-tree eclasses. travis-ci = { repository = "cardoe/cargo-ebuild" } [dependencies] -cargo = "0.16" +cargo = "0.17" rustc-serialize = "^0.3" time = "^0.1" diff --git a/src/main.rs b/src/main.rs index f0f21b2..e3a1598 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,7 @@ use cargo::core::registry::PackageRegistry; use cargo::core::resolver::Method; use cargo::ops; use cargo::util::{human, important_paths, CargoResult}; +use std::env; use std::error::Error; use std::fs::OpenOptions; use std::io::Write; @@ -67,10 +68,15 @@ Options: "#; fn main() { - cargo::execute_main_without_stdin(real_main, false, USAGE) + let config = Config::default().unwrap(); + let args = env::args().collect::<Vec<_>>(); + let result = cargo::call_main_without_stdin(real_main, &config, USAGE, &args, false); + if let Err(e) = result { + cargo::handle_cli_error(e, &mut *config.shell()); + } } -fn real_main(options: Options, config: &Config) -> CliResult<Option<()>> { +fn real_main(options: Options, config: &Config) -> CliResult { config.configure(options.flag_verbose, options.flag_quiet, /* color */ @@ -152,5 +158,5 @@ fn real_main(options: Options, config: &Config) -> CliResult<Option<()>> { println!("Wrote: {}", ebuild_path.display()); - Ok(None) + Ok(()) } |