Skip to content

Commit 6c82cf4

Browse files
committed
chore: update clap dependency to 4.1
Signed-off-by: Matheus Cardoso <matheus@cardo.so>
1 parent 6911681 commit 6c82cf4

File tree

23 files changed

+211
-178
lines changed

23 files changed

+211
-178
lines changed

Cargo.lock

Lines changed: 43 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async-trait = "0.1"
1717
bindle = { workspace = true }
1818
bytes = "1.1"
1919
chrono = "0.4"
20-
clap = { version = "3.1.15", features = ["derive", "env"] }
20+
clap = { version = "4.1.6", features = ["derive", "env"] }
2121
cloud = { path = "crates/cloud" }
2222
cloud-openapi = { git = "https://github.com/fermyon/cloud-openapi" }
2323
comfy-table = "5.0"

crates/abi-conformance/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = { workspace = true }
77
[dependencies]
88
anyhow = "1.0.44"
99
cap-std = "1.0.3"
10-
clap = { version = "3.1.15", features = ["derive", "env"] }
10+
clap = { version = "4.1.6", features = ["derive", "env"] }
1111
rand = "0.8.5"
1212
rand_chacha = "0.3.1"
1313
rand_core = "0.6.3"

crates/abi-conformance/src/bin/spin-abi-conformance.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ use std::{
88
use wasmtime::{Config, Engine, Module};
99

1010
#[derive(Parser)]
11-
#[clap(author, version, about)]
11+
#[command(author, version, about)]
1212
pub struct Options {
1313
/// Name of Wasm file to test (or stdin if not specified)
14-
#[clap(short, long)]
14+
#[arg(short, long)]
1515
pub input: Option<PathBuf>,
1616

1717
/// Name of JSON file to write report to (or stdout if not specified)
18-
#[clap(short, long)]
18+
#[arg(short, long)]
1919
pub output: Option<PathBuf>,
2020

2121
/// Name of TOML configuration file to use
22-
#[clap(short, long)]
22+
#[arg(short, long)]
2323
pub config: Option<PathBuf>,
2424
}
2525

crates/http/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ doctest = false
1010
[dependencies]
1111
anyhow = "1.0"
1212
async-trait = "0.1"
13-
clap = "3"
13+
clap = "4.1.6"
1414
futures = "0.3"
1515
futures-util = "0.3.8"
1616
http = "0.2"

crates/http/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ pub struct HttpTrigger {
5959
#[derive(Args)]
6060
pub struct CliArgs {
6161
/// IP address and port to listen on
62-
#[clap(long = "listen", default_value = "127.0.0.1:3000", value_parser = parse_listen_addr)]
62+
#[arg(long = "listen", default_value = "127.0.0.1:3000", value_parser = parse_listen_addr)]
6363
pub address: SocketAddr,
6464

6565
/// The path to the certificate to use for https, if this is not set, normal http will be used. The cert should be in PEM format
66-
#[clap(long, env = "SPIN_TLS_CERT", requires = "tls-key")]
66+
#[arg(long, env = "SPIN_TLS_CERT", requires = "tls_key")]
6767
pub tls_cert: Option<PathBuf>,
6868

6969
/// The path to the certificate key to use for https, if this is not set, normal http will be used. The key should be in PKCS#8 format
70-
#[clap(long, env = "SPIN_TLS_KEY", requires = "tls-cert")]
70+
#[arg(long, env = "SPIN_TLS_KEY", requires = "tls_cert")]
7171
pub tls_key: Option<PathBuf>,
7272
}
7373

crates/trigger/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = { workspace = true }
77
[dependencies]
88
anyhow = "1.0"
99
async-trait = "0.1"
10-
clap = { version = "3.1.15", features = ["derive", "env"] }
10+
clap = { version = "4.1", features = ["derive", "env"] }
1111
ctrlc = { version = "3.2", features = ["termination"] }
1212
dirs = "4"
1313
futures = "0.3"

crates/trigger/src/cli.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::path::PathBuf;
22

33
use anyhow::{Context, Result};
4-
use clap::{Args, IntoApp, Parser};
4+
use clap::{ArgAction, Args, CommandFactory, Parser};
55
use serde::de::DeserializeOwned;
66
use tokio::{
77
task::JoinHandle,
@@ -26,31 +26,31 @@ pub const SPIN_WORKING_DIR: &str = "SPIN_WORKING_DIR";
2626

2727
/// A command that runs a TriggerExecutor.
2828
#[derive(Parser, Debug)]
29-
#[clap(next_help_heading = "TRIGGER OPTIONS")]
29+
#[command(next_help_heading = "TRIGGER OPTIONS")]
3030
pub struct TriggerExecutorCommand<Executor: TriggerExecutor>
3131
where
3232
Executor::RunConfig: Args,
3333
{
3434
/// Log directory for the stdout and stderr of components.
35-
#[clap(
35+
#[arg(
3636
name = APP_LOG_DIR,
3737
short = 'L',
3838
long = "log-dir",
3939
)]
4040
pub log: Option<PathBuf>,
4141

4242
/// Disable Wasmtime cache.
43-
#[clap(
43+
#[arg(
4444
name = DISABLE_WASMTIME_CACHE,
4545
long = "disable-cache",
4646
env = DISABLE_WASMTIME_CACHE,
4747
conflicts_with = WASMTIME_CACHE_FILE,
48-
takes_value = false,
48+
num_args = 0,
4949
)]
5050
pub disable_cache: bool,
5151

5252
/// Wasmtime cache configuration file.
53-
#[clap(
53+
#[arg(
5454
name = WASMTIME_CACHE_FILE,
5555
long = "cache",
5656
env = WASMTIME_CACHE_FILE,
@@ -59,15 +59,15 @@ where
5959
pub cache: Option<PathBuf>,
6060

6161
/// Print output to stdout/stderr only for given component(s)
62-
#[clap(
62+
#[arg(
6363
name = FOLLOW_LOG_OPT,
6464
long = "follow",
65-
multiple_occurrences = true,
65+
action = ArgAction::Append,
6666
)]
6767
pub follow_components: Vec<String>,
6868

6969
/// Silence all component output to stdout/stderr
70-
#[clap(
70+
#[arg(
7171
long = "quiet",
7272
short = 'q',
7373
aliases = &["sh", "shush"],
@@ -76,25 +76,25 @@ where
7676
pub silence_component_logs: bool,
7777

7878
/// Set the static assets of the components in the temporary directory as writable.
79-
#[clap(long = "allow-transient-write")]
79+
#[arg(long = "allow-transient-write")]
8080
pub allow_transient_write: bool,
8181

8282
/// Configuration file for config providers and wasmtime config.
83-
#[clap(
83+
#[arg(
8484
name = RUNTIME_CONFIG_FILE,
8585
long = "runtime-config-file",
8686
env = RUNTIME_CONFIG_FILE,
8787
)]
8888
pub runtime_config_file: Option<PathBuf>,
8989

90-
#[clap(flatten)]
90+
#[command(flatten)]
9191
pub run_config: Executor::RunConfig,
9292

93-
#[clap(long = "help-args-only", hide = true)]
93+
#[arg(long = "help-args-only", hide = true)]
9494
pub help_args_only: bool,
9595

9696
/// Load the application from the registry.
97-
#[clap(long = "from-registry", hide = true)]
97+
#[arg(long = "from-registry", hide = true)]
9898
pub from_registry: bool,
9999
}
100100

examples/spin-timer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77
[dependencies]
88
anyhow = "1.0.68"
99
async-trait = "0.1"
10-
clap = { version = "3.1.15", features = ["derive", "env"] }
10+
clap = { version = "4.1", features = ["derive", "env"] }
1111
futures = "0.3.25"
1212
serde = "1.0"
1313
spin-core = { version = "0.7.1", path = "../../crates/core" }

examples/spin-timer/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::collections::HashMap;
22

33
use anyhow::Error;
4-
use clap::{Parser};
54
use serde::{Deserialize, Serialize};
65
use spin_trigger::{cli::TriggerExecutorCommand, TriggerExecutor, TriggerAppEngine};
76

0 commit comments

Comments
 (0)