mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 11:30:59 +00:00
examples: Update to clap 4
This commit is contained in:
parent
0b81ed2e34
commit
4ba4b00235
7 changed files with 22 additions and 18 deletions
|
@ -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 }
|
||||
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
||||
|
|
|
@ -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"] }
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -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>,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue