]> git.proxmox.com Git - rustc.git/blob - src/tools/cargo/src/bin/cargo/commands/logout.rs
New upstream version 1.70.0+dfsg2
[rustc.git] / src / tools / cargo / src / bin / cargo / commands / logout.rs
1 use crate::command_prelude::*;
2 use cargo::ops;
3
4 pub fn cli() -> Command {
5 subcommand("logout")
6 .about("Remove an API token from the registry locally")
7 .arg_quiet()
8 .arg(opt("registry", "Registry to use").value_name("REGISTRY"))
9 .after_help("Run `cargo help logout` for more detailed information.\n")
10 }
11
12 pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
13 let registry = args.registry(config)?;
14 ops::registry_logout(config, registry.as_deref())?;
15 Ok(())
16 }