From 6f6ad2b2eec9dbc9b3a1b0190d4a2dfd3c0b3bf6 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Tue, 16 May 2023 08:57:39 +0300 Subject: Update clap to v4.2.7 Fixes #6879. Fixes #6874. --- alacritty/src/cli.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'alacritty/src') diff --git a/alacritty/src/cli.rs b/alacritty/src/cli.rs index 38707036..7f39e527 100644 --- a/alacritty/src/cli.rs +++ b/alacritty/src/cli.rs @@ -4,7 +4,7 @@ use std::path::PathBuf; #[cfg(unix)] use clap::Subcommand; -use clap::{Args, Parser, ValueHint}; +use clap::{ArgAction, Args, Parser, ValueHint}; use log::{self, error, LevelFilter}; use serde::{Deserialize, Serialize}; use serde_yaml::Value; @@ -51,15 +51,15 @@ pub struct Options { pub socket: Option, /// Reduces the level of verbosity (the min level is -qq). - #[clap(short, conflicts_with("verbose"), parse(from_occurrences))] + #[clap(short, conflicts_with("verbose"), action = ArgAction::Count)] quiet: u8, /// Increases the level of verbosity (the max level is -vvv). - #[clap(short, conflicts_with("quiet"), parse(from_occurrences))] + #[clap(short, conflicts_with("quiet"), action = ArgAction::Count)] verbose: u8, /// Override configuration file options [example: cursor.style=Beam]. - #[clap(short = 'o', long, multiple_values = true)] + #[clap(short = 'o', long, num_args = 1..)] option: Vec, /// CLI options for config overrides. @@ -195,7 +195,7 @@ pub struct TerminalOptions { pub hold: bool, /// Command and args to execute (must be last argument). - #[clap(short = 'e', long, allow_hyphen_values = true, multiple_values = true)] + #[clap(short = 'e', long, allow_hyphen_values = true, num_args = 1..)] command: Vec, } @@ -242,7 +242,7 @@ pub struct WindowIdentity { pub title: Option, /// Defines window class/app_id on X11/Wayland [default: Alacritty]. - #[clap(long, value_name = "general> | ,, } @@ -330,7 +330,7 @@ mod tests { use std::io::Read; #[cfg(target_os = "linux")] - use clap::IntoApp; + use clap::CommandFactory; #[cfg(target_os = "linux")] use clap_complete::Shell; use serde_yaml::mapping::Mapping; @@ -446,7 +446,7 @@ mod tests { #[cfg(target_os = "linux")] #[test] fn completions() { - let mut clap = Options::into_app(); + let mut clap = Options::command(); for (shell, file) in &[ (Shell::Bash, "alacritty.bash"), -- cgit