]> git.proxmox.com Git - cargo.git/blob - src/bin/cargo/commands/package.rs
Undoing bad formatting changes and removing redundant struct fields
[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 )
13 .short("l"),
14 )
15 .arg(opt(
16 "no-verify",
17 "Don't verify the contents by building them",
18 ))
19 .arg(opt(
20 "no-metadata",
21 "Ignore warnings about a lack of human-usable metadata",
22 ))
23 .arg(opt(
24 "allow-dirty",
25 "Allow dirty working directories to be packaged",
26 ))
27 .arg_target_triple("Build for the target triple")
28 .arg_target_dir()
29 .arg_features()
30 .arg_manifest_path()
31 .arg_jobs()
32 }
33
34 pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
35 let ws = args.workspace(config)?;
36 ops::package(
37 &ws,
38 &PackageOpts {
39 config,
40 verify: !args.is_present("no-verify"),
41 list: args.is_present("list"),
42 check_metadata: !args.is_present("no-metadata"),
43 allow_dirty: args.is_present("allow-dirty"),
44 target: args.target(),
45 jobs: args.jobs()?,
46 features: args._values_of("features"),
47 all_features: args.is_present("all-features"),
48 },
49 )?;
50 Ok(())
51 }