From 077a31adb3922202ada72623d40c3a9e371e3df0 Mon Sep 17 00:00:00 2001 From: Andy Caldwell Date: Mon, 19 Nov 2018 21:41:09 +0000 Subject: [PATCH] Move command prelude into main library --- src/bin/cargo/main.rs | 3 +-- .../cargo => cargo/util}/command_prelude.rs | 18 +++++++++--------- src/cargo/util/mod.rs | 1 + 3 files changed, 11 insertions(+), 11 deletions(-) rename src/{bin/cargo => cargo/util}/command_prelude.rs (97%) diff --git a/src/bin/cargo/main.rs b/src/bin/cargo/main.rs index e0333ee10..979d89494 100644 --- a/src/bin/cargo/main.rs +++ b/src/bin/cargo/main.rs @@ -19,11 +19,10 @@ use std::path::{Path, PathBuf}; use std::collections::BTreeSet; use cargo::core::shell::Shell; -use cargo::util::{self, lev_distance, CargoResult, CliResult, Config}; +use cargo::util::{self, command_prelude, lev_distance, CargoResult, CliResult, Config}; use cargo::util::{CliError, ProcessError}; mod cli; -mod command_prelude; mod commands; use command_prelude::*; diff --git a/src/bin/cargo/command_prelude.rs b/src/cargo/util/command_prelude.rs similarity index 97% rename from src/bin/cargo/command_prelude.rs rename to src/cargo/util/command_prelude.rs index c8f2fc824..774e0fce6 100644 --- a/src/bin/cargo/command_prelude.rs +++ b/src/cargo/util/command_prelude.rs @@ -2,17 +2,17 @@ use std::path::PathBuf; use std::fs; use clap::{self, SubCommand}; -use cargo::CargoResult; -use cargo::core::Workspace; -use cargo::core::compiler::{BuildConfig, MessageFormat}; -use cargo::ops::{CompileFilter, CompileOptions, NewOptions, Packages, VersionControl}; -use cargo::sources::CRATES_IO_REGISTRY; -use cargo::util::paths; -use cargo::util::important_paths::find_root_manifest_for_wd; +use CargoResult; +use core::Workspace; +use core::compiler::{BuildConfig, MessageFormat}; +use ops::{CompileFilter, CompileOptions, NewOptions, Packages, VersionControl}; +use sources::CRATES_IO_REGISTRY; +use util::paths; +use util::important_paths::find_root_manifest_for_wd; pub use clap::{AppSettings, Arg, ArgMatches}; -pub use cargo::{CliError, CliResult, Config}; -pub use cargo::core::compiler::CompileMode; +pub use {CliError, CliResult, Config}; +pub use core::compiler::CompileMode; pub type App = clap::App<'static, 'static>; diff --git a/src/cargo/util/mod.rs b/src/cargo/util/mod.rs index c18914954..69f2d0e68 100644 --- a/src/cargo/util/mod.rs +++ b/src/cargo/util/mod.rs @@ -38,6 +38,7 @@ pub mod profile; pub mod to_semver; pub mod to_url; pub mod toml; +pub mod command_prelude; mod cfg; mod dependency_queue; mod rustc; -- 2.39.5