Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
clap_cargo - Rust
[go: Go Back, main page]

Crate clap_cargo

Source
Expand description

clap-cargo: Re-usable CLI flags for cargo plugins

§Examples

use clap::Parser;

// ...
#[derive(Debug, Parser)]
struct Cli {
    #[command(flatten)]
    manifest: clap_cargo::Manifest,
    #[command(flatten)]
    workspace: clap_cargo::Workspace,
    #[command(flatten)]
    features: clap_cargo::Features,
}

let cli = // ...
let mut metadata = cli.manifest.metadata();
cli.features.forward_metadata(&mut metadata);
let metadata = metadata.exec().unwrap();
let (selected, excluded) = cli.workspace.partition_packages(&metadata);

§Relevant crates

Other crates that might be useful for cargo plugins:

Modules§

style

Structs§

Features
Cargo Feature Flags.
Manifest
Cargo flag for selecting the relevant crate.
Workspace
Cargo flags for selecting crates in a workspace.