Skip to content

Commit

Permalink
fix: update clap from v3 to v4.5
Browse files Browse the repository at this point in the history
fixes #628
  • Loading branch information
panekj committed Jul 6, 2024
1 parent 56ce638 commit 2231ed8
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 66 deletions.
150 changes: 91 additions & 59 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/taplo-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ toml-test = []
[dependencies]
anyhow = { workspace = true, features = ["backtrace"] }
async-ctrlc = { version = "1.2.0", features = ["stream"], optional = true }
clap = { version = "3.0.0", features = ["derive", "cargo", "env"] }
clap = { version = "4.5.8", features = ["derive", "cargo", "env"] }
codespan-reporting = { version = "0.11.1" }
futures = { workspace = true }
glob = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/taplo-cli/bin/taplo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use clap::StructOpt;
use clap::Parser;
use std::process::exit;
use taplo_cli::{
args::{Colors, TaploArgs},
Expand Down
10 changes: 5 additions & 5 deletions crates/taplo-cli/src/args.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use clap::{crate_version, ArgEnum, Args, Parser, Subcommand};
use clap::{crate_version, Args, Parser, Subcommand, ValueEnum};
use std::path::PathBuf;
use url::Url;

Expand All @@ -7,7 +7,7 @@ use url::Url;
#[clap(bin_name = "taplo")]
#[clap(version = crate_version!())]
pub struct TaploArgs {
#[clap(long, arg_enum, global = true, default_value = "auto")]
#[clap(long, value_enum, global = true, default_value = "auto")]
pub colors: Colors,
/// Enable a verbose logging format.
#[clap(long, global = true)]
Expand All @@ -34,7 +34,7 @@ pub struct GeneralArgs {
pub no_auto_config: bool,
}

#[derive(Clone, Copy, ArgEnum)]
#[derive(Clone, Copy, ValueEnum)]
pub enum Colors {
/// Determine whether to colorize output automatically.
Auto,
Expand Down Expand Up @@ -190,7 +190,7 @@ pub struct GetCommand {
/// Comments and formatting will not be preserved.
/// It is possible to select arrays and individual values that are not tables,
/// in this case the output will not be a valid TOML document.
#[clap(short, long, arg_enum, default_value = "value")]
#[clap(short, long, value_enum, default_value = "value")]
pub output_format: OutputFormat,

/// Strip the trailing newline from the output.
Expand Down Expand Up @@ -229,7 +229,7 @@ pub struct GetCommand {
pub separator: Option<String>,
}

#[derive(Clone, Copy, ArgEnum)]
#[derive(Clone, Copy, ValueEnum)]
pub enum OutputFormat {
/// Extract the value outputting it in a text format.
Value,
Expand Down

0 comments on commit 2231ed8

Please sign in to comment.