upgrade dependencies, Cli::into_app() is deprecated and has been changed

This commit is contained in:
Medzik 2022-02-20 22:18:41 +01:00
parent 6e0a75787e
commit fb4238ac7d
No known key found for this signature in database
GPG Key ID: A5FAC1E185C112DB
7 changed files with 19 additions and 16 deletions

View File

@ -9,4 +9,4 @@ indent_size = 4
end_of_line = lf end_of_line = lf
charset = utf-8 charset = utf-8
trim_trailing_whitespace = true trim_trailing_whitespace = true
insert_final_newline = false insert_final_newline = false

1
.gitignore vendored
View File

@ -1 +1,2 @@
# Cargo
/target /target

View File

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased] ## [Unreleased]
### CLI ### CLI
- added completions - added completions
- update short aliases
### Other ### Other
- Added README - Added README

12
Cargo.lock generated
View File

@ -79,9 +79,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "clap" name = "clap"
version = "3.0.14" version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b63edc3f163b3c71ec8aa23f9bd6070f77edbf3d1d198b164afa90ff00e4ec62" checksum = "e5f1fea81f183005ced9e59cdb01737ef2423956dac5a6d731b06b2ecfaa3467"
dependencies = [ dependencies = [
"atty", "atty",
"bitflags", "bitflags",
@ -96,18 +96,18 @@ dependencies = [
[[package]] [[package]]
name = "clap_complete" name = "clap_complete"
version = "3.0.6" version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "678db4c39c013cc68b54d372bce2efc58e30a0337c497c9032fd196802df3bc3" checksum = "23eec4dd324308f49d8bf86a2732078c34d57955fec1e1d865554fc37c15d420"
dependencies = [ dependencies = [
"clap", "clap",
] ]
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "3.0.14" version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a1132dc3944b31c20dd8b906b3a9f0a5d0243e092d59171414969657ac6aa85" checksum = "5fd1122e63869df2cb309f449da1ad54a7c6dfeb7c7e6ccd8e0825d9eb93bb72"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro-error", "proc-macro-error",

View File

@ -18,11 +18,11 @@ codegen-units = 1
[dependencies] [dependencies]
better-panic = "0.3.0" better-panic = "0.3.0"
clap_complete = "3.0.6" clap_complete = "3.1.0"
colored = "2.0.0" colored = "2.0.0"
discord-rich-presence = "0.1.8" discord-rich-presence = "0.1.8"
ctrlc = "3.2.1" ctrlc = "3.2.1"
[dependencies.clap] [dependencies.clap]
version = "3.0.14" version = "3.1.0"
features = ["derive", "cargo", "std"] features = ["derive", "cargo", "std"]

View File

@ -33,7 +33,7 @@ pub struct Cli {
pub state: String, pub state: String,
#[clap( #[clap(
short = 'N', short = 'I',
long = "large-image", long = "large-image",
help = "Large Image name", help = "Large Image name",
default_value = "none", default_value = "none",
@ -43,7 +43,7 @@ pub struct Cli {
pub large_image: String, pub large_image: String,
#[clap( #[clap(
short = 'I', short = 'T',
long = "large-image-text", long = "large-image-text",
help = "Large Image text", help = "Large Image text",
default_value = "none", default_value = "none",
@ -53,7 +53,7 @@ pub struct Cli {
pub large_text: String, pub large_text: String,
#[clap( #[clap(
short = 'n', short = 'i',
long = "small-image", long = "small-image",
help = "Small Image name", help = "Small Image name",
default_value = "none", default_value = "none",
@ -63,7 +63,7 @@ pub struct Cli {
pub small_image: String, pub small_image: String,
#[clap( #[clap(
short = 'i', short = 't',
long = "small-image-text", long = "small-image-text",
help = "Small Image text", help = "Small Image text",
default_value = "none", default_value = "none",
@ -83,7 +83,7 @@ pub struct Cli {
pub button_1_text: String, pub button_1_text: String,
#[clap( #[clap(
short = 'T', short = 'U',
long = "button-1-url", long = "button-1-url",
help = "Button 1 URL address", help = "Button 1 URL address",
default_value = "none", default_value = "none",
@ -103,7 +103,7 @@ pub struct Cli {
pub button_2_text: String, pub button_2_text: String,
#[clap( #[clap(
short = 't', short = 'u',
long = "button-2-url", long = "button-2-url",
help = "Button 2 URL address", help = "Button 2 URL address",
default_value = "none", default_value = "none",

View File

@ -29,7 +29,7 @@ fn main() {
let args = Cli::parse(); let args = Cli::parse();
if let Some(shell) = args.print_completions { if let Some(shell) = args.print_completions {
let mut clap_app = Cli::into_app(); let mut clap_app = Cli::command();
let app_name = clap_app.get_name().to_string(); let app_name = clap_app.get_name().to_string();
generate(shell, &mut clap_app, app_name, &mut io::stdout()); generate(shell, &mut clap_app, app_name, &mut io::stdout());
@ -133,6 +133,7 @@ fn main() {
); );
loop { loop {
// * empty `loop {}` wastes CPU cycles
sleep(Duration::new(9999999, 9999999)); sleep(Duration::new(9999999, 9999999));
} }
} }