diff --git a/crates/cli/src/commands/config.rs b/crates/cli/src/commands/config.rs index e3db7121..9eefefe4 100644 --- a/crates/cli/src/commands/config.rs +++ b/crates/cli/src/commands/config.rs @@ -19,7 +19,7 @@ use tracing::info; #[derive(Parser, Debug)] pub(super) struct Options { - #[clap(subcommand)] + #[command(subcommand)] subcommand: Subcommand, } diff --git a/crates/cli/src/commands/database.rs b/crates/cli/src/commands/database.rs index 722c3235..b1e296d3 100644 --- a/crates/cli/src/commands/database.rs +++ b/crates/cli/src/commands/database.rs @@ -19,7 +19,7 @@ use mas_storage::MIGRATOR; #[derive(Parser, Debug)] pub(super) struct Options { - #[clap(subcommand)] + #[command(subcommand)] subcommand: Subcommand, } diff --git a/crates/cli/src/commands/debug.rs b/crates/cli/src/commands/debug.rs index 3325f175..5ba65631 100644 --- a/crates/cli/src/commands/debug.rs +++ b/crates/cli/src/commands/debug.rs @@ -24,7 +24,7 @@ use tracing::info; #[derive(Parser, Debug)] pub(super) struct Options { - #[clap(subcommand)] + #[command(subcommand)] subcommand: Subcommand, } @@ -33,11 +33,11 @@ enum Subcommand { /// Perform an HTTP request with the default HTTP client Http { /// Show response headers - #[clap(long, short = 'I')] + #[arg(long, short = 'I')] show_headers: bool, /// Parse the response as JSON - #[clap(long, short = 'j')] + #[arg(long, short = 'j')] json: bool, /// URI where to perform a GET request diff --git a/crates/cli/src/commands/manage.rs b/crates/cli/src/commands/manage.rs index 33ed1783..3605bb2f 100644 --- a/crates/cli/src/commands/manage.rs +++ b/crates/cli/src/commands/manage.rs @@ -25,7 +25,7 @@ use tracing::{info, warn}; #[derive(Parser, Debug)] pub(super) struct Options { - #[clap(subcommand)] + #[command(subcommand)] subcommand: Subcommand, } @@ -43,7 +43,7 @@ enum Subcommand { /// Import clients from config ImportClients { /// Remove all clients before importing - #[clap(long)] + #[arg(long)] truncate: bool, }, } diff --git a/crates/cli/src/commands/mod.rs b/crates/cli/src/commands/mod.rs index 043e8684..604463b2 100644 --- a/crates/cli/src/commands/mod.rs +++ b/crates/cli/src/commands/mod.rs @@ -49,10 +49,10 @@ enum Subcommand { #[derive(Parser, Debug)] pub struct Options { /// Path to the configuration file - #[clap(short, long, global = true, multiple_occurrences(true))] + #[arg(short, long, global = true, action = clap::ArgAction::Append)] config: Vec, - #[clap(subcommand)] + #[command(subcommand)] subcommand: Option, } diff --git a/crates/cli/src/commands/server.rs b/crates/cli/src/commands/server.rs index f66bfb0c..fedc344a 100644 --- a/crates/cli/src/commands/server.rs +++ b/crates/cli/src/commands/server.rs @@ -37,11 +37,11 @@ use tracing::{error, info}; #[derive(Parser, Debug, Default)] pub(super) struct Options { /// Automatically apply pending migrations - #[clap(long)] + #[arg(long)] migrate: bool, /// Watch for changes for templates on the filesystem - #[clap(short, long)] + #[arg(short, long)] watch: bool, } diff --git a/crates/cli/src/commands/templates.rs b/crates/cli/src/commands/templates.rs index 26ba8c7b..9d71e6ff 100644 --- a/crates/cli/src/commands/templates.rs +++ b/crates/cli/src/commands/templates.rs @@ -32,7 +32,7 @@ enum Subcommand { path: PathBuf, /// Overwrite existing template files - #[clap(long)] + #[arg(long)] overwrite: bool, }, @@ -42,7 +42,7 @@ enum Subcommand { path: String, /// Skip loading builtin templates - #[clap(long)] + #[arg(long)] skip_builtin: bool, }, } diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index c83a8b8f..44f4340c 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -20,7 +20,7 @@ use std::path::PathBuf; use anyhow::Context; -use clap::StructOpt; +use clap::Parser; use mas_config::TelemetryConfig; use tracing_subscriber::{ filter::LevelFilter, layer::SubscriberExt, reload, util::SubscriberInitExt, EnvFilter, Layer,