]> git.proxmox.com Git - cargo.git/blob - src/bin/cargo/commands/package.rs
Auto merge of #6387 - dwijnand:rust-2018, r=dwijnand
[cargo.git] / src / bin / cargo / commands / package.rs
1 use crate::command_prelude::*;
2
3 use cargo::ops::{self, PackageOpts};
4
5 pub fn cli() -> App {
6 subcommand("package")
7 .about("Assemble the local package into a distributable tarball")
8 .arg(
9 opt(
10 "list",
11 "Print files included in a package without making one",
12 ).short("l"),
13 )
14 .arg(opt(
15 "no-verify",
16 "Don't verify the contents by building them",
17 ))
18 .arg(opt(
19 "no-metadata",
20 "Ignore warnings about a lack of human-usable metadata",
21 ))
22 .arg(opt(
23 "allow-dirty",
24 "Allow dirty working directories to be packaged",
25 ))
26 .arg_target_triple("Build for the target triple")
27 .arg_target_dir()
28 .arg_manifest_path()
29 .arg_jobs()
30 }
31
32 pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
33 let ws = args.workspace(config)?;
34 ops::package(
35 &ws,
36 &PackageOpts {
37 config,
38 verify: !args.is_present("no-verify"),
39 list: args.is_present("list"),
40 check_metadata: !args.is_present("no-metadata"),
41 allow_dirty: args.is_present("allow-dirty"),
42 target: args.target(),
43 jobs: args.jobs()?,
44 registry: None,
45 },
46 )?;
47 Ok(())
48 }