]> git.proxmox.com Git - cargo.git/blob - src/bin/cargo/commands/package.rs
Rewrite `login` and registry cleanups.
[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_manifest_path()
30 .arg_jobs()
31 }
32
33 pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
34 let ws = args.workspace(config)?;
35 ops::package(
36 &ws,
37 &PackageOpts {
38 config,
39 verify: !args.is_present("no-verify"),
40 list: args.is_present("list"),
41 check_metadata: !args.is_present("no-metadata"),
42 allow_dirty: args.is_present("allow-dirty"),
43 target: args.target(),
44 jobs: args.jobs()?,
45 },
46 )?;
47 Ok(())
48 }