diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2022-09-29 09:48:53 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2022-09-29 09:48:53 +0300 |
commit | 4ba4b002353dc0808262296bf5ee4739f0a2512c (patch) | |
tree | be0472cf6706c9122911f69c8561a771d02d49de | |
parent | 0b81ed2e34fabd6ba0d701ed092349d4e81446e4 (diff) |
examples: Update to clap 4
-rw-r--r-- | generic/sodium/Cargo.toml | 2 | ||||
-rw-r--r-- | generic/sodium/examples/decrypt_example.rs | 7 | ||||
-rw-r--r-- | generic/sodium/examples/encrypt_example.rs | 11 | ||||
-rw-r--r-- | generic/sodium/examples/generate_keys.rs | 11 | ||||
-rw-r--r-- | generic/threadshare/Cargo.toml | 2 | ||||
-rw-r--r-- | utils/uriplaylistbin/Cargo.toml | 2 | ||||
-rw-r--r-- | utils/uriplaylistbin/examples/playlist.rs | 5 |
7 files changed, 22 insertions, 18 deletions
diff --git a/generic/sodium/Cargo.toml b/generic/sodium/Cargo.toml index 736e2a037..fda10690e 100644 --- a/generic/sodium/Cargo.toml +++ b/generic/sodium/Cargo.toml @@ -17,7 +17,7 @@ hex = "0.4" smallvec = "1.0" # example -clap = { version = "3.2", optional = true, features = ["derive"] } +clap = { version = "4", optional = true, features = ["derive"] } serde = { version = "1.0", features = ["derive"], optional = true } serde_json = { version = "1.0", optional = true } diff --git a/generic/sodium/examples/decrypt_example.rs b/generic/sodium/examples/decrypt_example.rs index bd87bd6d8..5a0a9d2fb 100644 --- a/generic/sodium/examples/decrypt_example.rs +++ b/generic/sodium/examples/decrypt_example.rs @@ -34,15 +34,14 @@ use clap::Parser; use serde::{Deserialize, Serialize}; #[derive(Parser, Debug)] -#[clap(version, author)] -#[clap(about = "Decrypt a gstsodium10 file")] +#[clap(version, author, about = "Decrypt a gstsodium10 file")] struct Args { /// File to encrypt - #[clap(short, long, action)] + #[clap(short, long)] input: String, /// File to decrypt - #[clap(short, long, action)] + #[clap(short, long)] output: String, } diff --git a/generic/sodium/examples/encrypt_example.rs b/generic/sodium/examples/encrypt_example.rs index d4b215b91..c8cd97bf8 100644 --- a/generic/sodium/examples/encrypt_example.rs +++ b/generic/sodium/examples/encrypt_example.rs @@ -34,15 +34,18 @@ use clap::Parser; use serde::{Deserialize, Serialize}; #[derive(Parser, Debug)] -#[clap(version, author)] -#[clap(about = "Encrypt a file with in the gstsodium10 format")] +#[clap( + version, + author, + about = "Encrypt a file with in the gstsodium10 format" +)] struct Args { /// File to encrypt - #[clap(short, long, action)] + #[clap(short, long)] input: String, /// File to decrypt - #[clap(short, long, action)] + #[clap(short, long)] output: String, } diff --git a/generic/sodium/examples/generate_keys.rs b/generic/sodium/examples/generate_keys.rs index 106830b2b..4186eb4b5 100644 --- a/generic/sodium/examples/generate_keys.rs +++ b/generic/sodium/examples/generate_keys.rs @@ -29,15 +29,18 @@ use std::fs::File; use std::path::PathBuf; #[derive(Parser, Debug)] -#[clap(version, author)] -#[clap(about = "Generate a pair of Sodium's crypto_box_curve25519xsalsa20poly1305 keys.")] +#[clap( + version, + author, + about = "Generate a pair of Sodium's crypto_box_curve25519xsalsa20poly1305 keys." +)] struct Args { /// Path to write the Keys - #[clap(short, long, action)] + #[clap(short, long)] path: PathBuf, /// Write a JSON file instead of a key.prv/key.pub pair - #[clap(short, long, action)] + #[clap(short, long)] json: bool, } diff --git a/generic/threadshare/Cargo.toml b/generic/threadshare/Cargo.toml index cd14971a3..7503de9c0 100644 --- a/generic/threadshare/Cargo.toml +++ b/generic/threadshare/Cargo.toml @@ -27,7 +27,7 @@ socket2 = {features = ["all"], version = "0.4"} waker-fn = "1.1" # Used by examples -clap = { version = "3.2", features = ["derive"], optional = true } +clap = { version = "4", features = ["derive"], optional = true } [target.'cfg(windows)'.dependencies] winapi = { version = "0.3.9", features = ["winsock2", "processthreadsapi"] } diff --git a/utils/uriplaylistbin/Cargo.toml b/utils/uriplaylistbin/Cargo.toml index ded337ca5..508337c95 100644 --- a/utils/uriplaylistbin/Cargo.toml +++ b/utils/uriplaylistbin/Cargo.toml @@ -12,7 +12,7 @@ rust-version = "1.63" gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } once_cell = "1.0" anyhow = "1" -clap = { version = "3.2", optional = true, features = ["derive"] } +clap = { version = "4", optional = true, features = ["derive"] } [dev-dependencies] gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } diff --git a/utils/uriplaylistbin/examples/playlist.rs b/utils/uriplaylistbin/examples/playlist.rs index fdbf779f3..3ea879c64 100644 --- a/utils/uriplaylistbin/examples/playlist.rs +++ b/utils/uriplaylistbin/examples/playlist.rs @@ -16,10 +16,9 @@ use clap::Parser; use gst::prelude::*; #[derive(Debug, Parser)] -#[clap(version, author)] -#[clap(about = "An example of uriplaylistbin usage.")] +#[clap(version, author, about = "An example of uriplaylistbin usage.")] struct Opt { - #[clap(short, default_value = "1", action)] + #[clap(short, default_value = "1")] iterations: u32, uris: Vec<String>, } |