Remove the pkgid arg and replace the profile flag with package.

This commit is contained in:
Sondre Lefsaker 2015-05-02 12:19:55 +02:00
parent b177d2ab56
commit 512b217b0b
2 changed files with 20 additions and 22 deletions

View file

@ -7,9 +7,8 @@ use cargo::util::{CliResult, CliError, Config};
#[derive(RustcDecodable)]
struct Options {
arg_pkgid: Option<String>,
arg_opts: Option<Vec<String>>,
flag_profile: Option<String>,
flag_package: Option<String>,
flag_jobs: Option<u32>,
flag_features: Vec<String>,
flag_no_default_features: bool,
@ -28,23 +27,23 @@ pub const USAGE: &'static str = "
Compile a package and all of its dependencies
Usage:
cargo rustc [options] [<pkgid>] [--] [<opts>...]
cargo rustc [options] [--] [<opts>...]
Options:
-h, --help Print this message
-p, --profile PROFILE The profile to compile for
-j N, --jobs N The number of jobs to run in parallel
--lib Build only this package's library
--bin NAME Build only the specified binary
--example NAME Build only the specified example
--test NAME Build only the specified test
--bench NAME Build only the specified benchmark
--release Build artifacts in release mode, with optimizations
--features FEATURES Features to compile for the package
--no-default-features Do not compile default features for the package
--target TRIPLE Target triple which compiles will be for
--manifest-path PATH Path to the manifest to fetch depednencies for
-v, --verbose Use verbose output
-h, --help Print this message
-p SPEC, --package SPEC The profile to compile for
-j N, --jobs N The number of jobs to run in parallel
--lib Build only this package's library
--bin NAME Build only the specified binary
--example NAME Build only the specified example
--test NAME Build only the specified test
--bench NAME Build only the specified benchmark
--release Build artifacts in release mode, with optimizations
--features FEATURES Features to compile for the package
--no-default-features Do not compile default features for the package
--target TRIPLE Target triple which compiles will be for
--manifest-path PATH Path to the manifest to fetch depednencies for
-v, --verbose Use verbose output
The <pkgid> specified (defaults to the current package) will have all of its
dependencies compiled, and then the package itself will be compiled. This
@ -68,7 +67,6 @@ pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
config.shell().set_verbose(options.flag_verbose);
let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path));
let spec = options.arg_pkgid.as_ref().map(|s| &s[..]);
let opts = CompileOptions {
config: config,
@ -76,7 +74,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
target: options.flag_target.as_ref().map(|t| &t[..]),
features: &options.flag_features,
no_default_features: options.flag_no_default_features,
spec: spec,
spec: options.flag_package.as_ref().map(|s| &s[..]),
exec_engine: None,
mode: ops::CompileMode::Build,
release: options.flag_release,

View file

@ -43,7 +43,7 @@ test!(build_lib_for_foo {
"#)
.file("src/lib.rs", r#" "#);
assert_that(p.cargo_process("rustc").arg("--lib").arg("-v").arg("foo"),
assert_that(p.cargo_process("rustc").arg("--lib").arg("-v"),
execs()
.with_status(0)
.with_stdout(verbose_output_for_target(true, &p)));
@ -63,7 +63,7 @@ test!(build_lib_and_allow_unstable_options {
"#)
.file("src/lib.rs", r#" "#);
assert_that(p.cargo_process("rustc").arg("--lib").arg("-v").arg("foo")
assert_that(p.cargo_process("rustc").arg("--lib").arg("-v")
.arg("--").arg("-Z").arg("unstable-options"),
execs()
.with_status(0)
@ -84,7 +84,7 @@ test!(build_main_and_allow_unstable_options {
fn main() {}
"#);
assert_that(p.cargo_process("rustc").arg("-v").arg("foo")
assert_that(p.cargo_process("rustc").arg("-v")
.arg("--").arg("-Z").arg("unstable-options"),
execs()
.with_status(0)