Update clap to stable version

This commit is contained in:
silverpill 2022-04-10 19:51:03 +00:00
parent 30bd3d6a37
commit 541894f4df
3 changed files with 24 additions and 48 deletions

49
Cargo.lock generated
View file

@ -497,9 +497,9 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "3.0.0-beta.2" version = "3.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bd1061998a501ee7d4b6d449020df3266ca3124b941ec56cf2005c3779ca142" checksum = "71c47df61d9e16dc010b55dba1952a57d8c215dbb533fd13cdd13369aac73b1c"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"clap_derive", "clap_derive",
@ -507,15 +507,13 @@ dependencies = [
"lazy_static", "lazy_static",
"os_str_bytes", "os_str_bytes",
"textwrap", "textwrap",
"unicode-width",
"vec_map",
] ]
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "3.0.0-beta.2" version = "3.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "370f715b81112975b1b69db93e0b56ea4cd4e5002ac43b2da8474106a54096a1" checksum = "a3aab4734e083b809aaf5794e14e756d1c798d2c69c7f7de7a09a2f5214993c1"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro-error", "proc-macro-error",
@ -1120,12 +1118,9 @@ dependencies = [
[[package]] [[package]]
name = "heck" name = "heck"
version = "0.3.2" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
dependencies = [
"unicode-segmentation",
]
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
@ -1812,9 +1807,12 @@ dependencies = [
[[package]] [[package]]
name = "os_str_bytes" name = "os_str_bytes"
version = "2.4.0" version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85" checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"
dependencies = [
"memchr",
]
[[package]] [[package]]
name = "parity-scale-codec" name = "parity-scale-codec"
@ -2959,12 +2957,9 @@ dependencies = [
[[package]] [[package]]
name = "textwrap" name = "textwrap"
version = "0.12.1" version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "203008d98caf094106cfaba70acfed15e18ed3ddb7d94e49baec153a2b462789" checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb"
dependencies = [
"unicode-width",
]
[[package]] [[package]]
name = "thiserror" name = "thiserror"
@ -3242,18 +3237,6 @@ dependencies = [
"tinyvec", "tinyvec",
] ]
[[package]]
name = "unicode-segmentation"
version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796"
[[package]]
name = "unicode-width"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
[[package]] [[package]]
name = "unicode-xid" name = "unicode-xid"
version = "0.2.1" version = "0.2.1"
@ -3305,12 +3288,6 @@ version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "vec_map"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]] [[package]]
name = "version_check" name = "version_check"
version = "0.9.3" version = "0.9.3"

View file

@ -24,8 +24,7 @@ base64 = "0.13.0"
# Used for working with dates # Used for working with dates
chrono = { version = "0.4.19", features = ["serde"] } chrono = { version = "0.4.19", features = ["serde"] }
# Used to build admin CLI tool # Used to build admin CLI tool
# Versions greater than beta.2 require Rust 1.54 clap = { version = "3.1.8", default-features = false, features = ["std", "derive"] }
clap = { version = "3.0.0-beta.2", default-features = false, features = ["std", "derive"] }
# Used for pooling database connections # Used for pooling database connections
deadpool = "0.9.2" deadpool = "0.9.2"
deadpool-postgres = { version = "0.10.2", default-features = false } deadpool-postgres = { version = "0.10.2", default-features = false }

View file

@ -1,5 +1,5 @@
use chrono::{Duration, Utc}; use chrono::{Duration, Utc};
use clap::Clap; use clap::Parser;
use uuid::Uuid; use uuid::Uuid;
use mitra::config; use mitra::config;
@ -17,13 +17,13 @@ use mitra::models::users::queries::{
use mitra::utils::crypto::{generate_private_key, serialize_private_key}; use mitra::utils::crypto::{generate_private_key, serialize_private_key};
/// Admin CLI tool /// Admin CLI tool
#[derive(Clap)] #[derive(Parser)]
struct Opts { struct Opts {
#[clap(subcommand)] #[clap(subcommand)]
subcmd: SubCommand, subcmd: SubCommand,
} }
#[derive(Clap)] #[derive(Parser)]
enum SubCommand { enum SubCommand {
GenerateRsaKey(GenerateRsaKey), GenerateRsaKey(GenerateRsaKey),
GenerateEthereumAddress(GenerateEthereumAddress), GenerateEthereumAddress(GenerateEthereumAddress),
@ -36,7 +36,7 @@ enum SubCommand {
} }
/// Generate RSA private key /// Generate RSA private key
#[derive(Clap)] #[derive(Parser)]
struct GenerateRsaKey; struct GenerateRsaKey;
impl GenerateRsaKey { impl GenerateRsaKey {
@ -48,33 +48,33 @@ impl GenerateRsaKey {
} }
/// Generate ethereum address /// Generate ethereum address
#[derive(Clap)] #[derive(Parser)]
struct GenerateEthereumAddress; struct GenerateEthereumAddress;
/// Generate invite code /// Generate invite code
#[derive(Clap)] #[derive(Parser)]
struct GenerateInviteCode; struct GenerateInviteCode;
/// List invite codes /// List invite codes
#[derive(Clap)] #[derive(Parser)]
struct ListInviteCodes; struct ListInviteCodes;
/// Delete profile /// Delete profile
#[derive(Clap)] #[derive(Parser)]
struct DeleteProfile { struct DeleteProfile {
#[clap(short)] #[clap(short)]
id: Uuid, id: Uuid,
} }
/// Delete post /// Delete post
#[derive(Clap)] #[derive(Parser)]
struct DeletePost { struct DeletePost {
#[clap(short)] #[clap(short)]
id: Uuid, id: Uuid,
} }
/// Delete old remote posts /// Delete old remote posts
#[derive(Clap)] #[derive(Parser)]
struct DeleteExtraneousPosts { struct DeleteExtraneousPosts {
#[clap(short)] #[clap(short)]
days: i64, days: i64,