From fb4238ac7d569e05f85327c8f09f1fc9ebb4a0da Mon Sep 17 00:00:00 2001 From: Medzik Date: Sun, 20 Feb 2022 22:18:41 +0100 Subject: [PATCH] upgrade dependencies, Cli::into_app() is deprecated and has been changed --- .editorconfig | 2 +- .gitignore | 1 + CHANGELOG.md | 1 + Cargo.lock | 12 ++++++------ Cargo.toml | 4 ++-- src/cli/parse.rs | 12 ++++++------ src/main.rs | 3 ++- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.editorconfig b/.editorconfig index a1027e5..10f6dda 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,4 +9,4 @@ indent_size = 4 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true -insert_final_newline = false \ No newline at end of file +insert_final_newline = false diff --git a/.gitignore b/.gitignore index ea8c4bf..f675e85 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +# Cargo /target diff --git a/CHANGELOG.md b/CHANGELOG.md index f5fae38..fff86de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### CLI - added completions +- update short aliases ### Other - Added README diff --git a/Cargo.lock b/Cargo.lock index 9c44777..16a71b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -79,9 +79,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "3.0.14" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63edc3f163b3c71ec8aa23f9bd6070f77edbf3d1d198b164afa90ff00e4ec62" +checksum = "e5f1fea81f183005ced9e59cdb01737ef2423956dac5a6d731b06b2ecfaa3467" dependencies = [ "atty", "bitflags", @@ -96,18 +96,18 @@ dependencies = [ [[package]] name = "clap_complete" -version = "3.0.6" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678db4c39c013cc68b54d372bce2efc58e30a0337c497c9032fd196802df3bc3" +checksum = "23eec4dd324308f49d8bf86a2732078c34d57955fec1e1d865554fc37c15d420" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "3.0.14" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1132dc3944b31c20dd8b906b3a9f0a5d0243e092d59171414969657ac6aa85" +checksum = "5fd1122e63869df2cb309f449da1ad54a7c6dfeb7c7e6ccd8e0825d9eb93bb72" dependencies = [ "heck", "proc-macro-error", diff --git a/Cargo.toml b/Cargo.toml index ce01c7f..617b923 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,11 +18,11 @@ codegen-units = 1 [dependencies] better-panic = "0.3.0" -clap_complete = "3.0.6" +clap_complete = "3.1.0" colored = "2.0.0" discord-rich-presence = "0.1.8" ctrlc = "3.2.1" [dependencies.clap] -version = "3.0.14" +version = "3.1.0" features = ["derive", "cargo", "std"] diff --git a/src/cli/parse.rs b/src/cli/parse.rs index a8bfb02..eabab05 100644 --- a/src/cli/parse.rs +++ b/src/cli/parse.rs @@ -33,7 +33,7 @@ pub struct Cli { pub state: String, #[clap( - short = 'N', + short = 'I', long = "large-image", help = "Large Image name", default_value = "none", @@ -43,7 +43,7 @@ pub struct Cli { pub large_image: String, #[clap( - short = 'I', + short = 'T', long = "large-image-text", help = "Large Image text", default_value = "none", @@ -53,7 +53,7 @@ pub struct Cli { pub large_text: String, #[clap( - short = 'n', + short = 'i', long = "small-image", help = "Small Image name", default_value = "none", @@ -63,7 +63,7 @@ pub struct Cli { pub small_image: String, #[clap( - short = 'i', + short = 't', long = "small-image-text", help = "Small Image text", default_value = "none", @@ -83,7 +83,7 @@ pub struct Cli { pub button_1_text: String, #[clap( - short = 'T', + short = 'U', long = "button-1-url", help = "Button 1 URL address", default_value = "none", @@ -103,7 +103,7 @@ pub struct Cli { pub button_2_text: String, #[clap( - short = 't', + short = 'u', long = "button-2-url", help = "Button 2 URL address", default_value = "none", diff --git a/src/main.rs b/src/main.rs index 84e3d71..f8703e5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,7 +29,7 @@ fn main() { let args = Cli::parse(); 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(); generate(shell, &mut clap_app, app_name, &mut io::stdout()); @@ -133,6 +133,7 @@ fn main() { ); loop { + // * empty `loop {}` wastes CPU cycles sleep(Duration::new(9999999, 9999999)); } }