-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #3011 - Turbo87:crates-admin, r=jtgeibel
Implement `crates-admin` binary This PR resolves #1504 by adding a new `crates-admin` binary, that combines a lot of the previously separate binaries as subcommands. I would recommend to review commit-by-commit :) r? `@jtgeibel`
- Loading branch information
Showing
14 changed files
with
95 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
pub mod delete_crate; | ||
pub mod delete_version; | ||
pub mod dialoguer; | ||
pub mod on_call; | ||
pub mod populate; | ||
pub mod render_readmes; | ||
pub mod test_pagerduty; | ||
pub mod transfer_crates; | ||
pub mod verify_token; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#![warn(clippy::all, rust_2018_idioms)] | ||
|
||
use cargo_registry::admin::{ | ||
delete_crate, delete_version, populate, render_readmes, test_pagerduty, transfer_crates, | ||
verify_token, | ||
}; | ||
|
||
use clap::Clap; | ||
|
||
#[derive(Clap, Debug)] | ||
#[clap(name = "crates-admin")] | ||
struct Opts { | ||
#[clap(subcommand)] | ||
command: SubCommand, | ||
} | ||
|
||
#[derive(Clap, Debug)] | ||
enum SubCommand { | ||
DeleteCrate(delete_crate::Opts), | ||
DeleteVersion(delete_version::Opts), | ||
Populate(populate::Opts), | ||
RenderReadmes(render_readmes::Opts), | ||
TestPagerduty(test_pagerduty::Opts), | ||
TransferCrates(transfer_crates::Opts), | ||
VerifyToken(verify_token::Opts), | ||
} | ||
|
||
fn main() { | ||
let opts: Opts = Opts::parse(); | ||
|
||
match opts.command { | ||
SubCommand::DeleteCrate(opts) => delete_crate::run(opts), | ||
SubCommand::DeleteVersion(opts) => delete_version::run(opts), | ||
SubCommand::Populate(opts) => populate::run(opts), | ||
SubCommand::RenderReadmes(opts) => render_readmes::run(opts), | ||
SubCommand::TestPagerduty(opts) => test_pagerduty::run(opts).unwrap(), | ||
SubCommand::TransferCrates(opts) => transfer_crates::run(opts), | ||
SubCommand::VerifyToken(opts) => verify_token::run(opts).unwrap(), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters