Skip to content

Commit 4edfc12

Browse files
authored
Merge pull request #31 from epage/v4
refactor: Upgrade to v4
2 parents aaa799a + 7c10288 commit 4edfc12

File tree

3 files changed

+28
-54
lines changed

3 files changed

+28
-54
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ documentation = "https://github.com/gitext-rs/git-branch-stash.git"
1313
readme = "README.md"
1414
categories = ["command-line-interface", "development-tools"]
1515
keywords = ["git", "cli"]
16-
edition = "2018"
16+
edition = "2021"
1717
rust-version = "1.60.0" # MSRV
1818
include = [
1919
"src/**/*",
@@ -39,16 +39,16 @@ path = "src/main.rs"
3939
doc = false
4040

4141
[dependencies]
42-
clap = { version = "3.2", features = ["derive"] }
43-
clap-verbosity-flag = "1.0"
42+
clap = { version = "4.0.0", features = ["derive"] }
43+
clap-verbosity-flag = "2.0"
4444
env_logger = { version = "0.9", default-features = false, features = ["termcolor"] }
4545
log = "0.4"
4646
proc-exit = "1"
4747
eyre = "0.6"
4848
human-panic = "1"
4949
yansi = "0.5.1"
5050
concolor = "0.0.8"
51-
concolor-clap = { version = "0.0.10", features = ["api_unstable"] }
51+
concolor-clap = { version = "0.0.11", features = ["api_unstable"] }
5252

5353
git-branch-stash = { version = "0.8.0", path = "crates/git-branch-stash" }
5454
git2 = { version = "0.14", default-features = false, features = ["vendored-libgit2"] }

src/args.rs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
#[derive(Debug, clap::Parser)]
2-
#[clap(name = "git-branch-stash", about, author, version)]
3-
#[clap(
4-
setting = clap::AppSettings::DeriveDisplayOrder,
5-
dont_collapse_args_in_usage = true,
2+
#[command(name = "git-branch-stash", about, author, version)]
3+
#[command(
64
args_conflicts_with_subcommands = true,
75
color = concolor_clap::color_choice(),
86
)]
97
pub struct Args {
10-
#[clap(subcommand)]
8+
#[command(subcommand)]
119
pub subcommand: Option<Subcommand>,
1210

13-
#[clap(flatten)]
11+
#[command(flatten)]
1412
pub push: PushArgs,
1513

16-
#[clap(flatten)]
14+
#[command(flatten)]
1715
pub(crate) color: concolor_clap::Color,
1816

19-
#[clap(flatten)]
17+
#[command(flatten)]
2018
pub verbose: clap_verbosity_flag::Verbosity<clap_verbosity_flag::InfoLevel>,
2119
}
2220

@@ -41,39 +39,39 @@ pub enum Subcommand {
4139
#[derive(Debug, clap::Args)]
4240
pub struct PushArgs {
4341
/// Specify which stash stack to use
44-
#[clap(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
42+
#[arg(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
4543
pub stack: String,
4644

4745
/// Annotate the snapshot with the given message
48-
#[clap(short, long)]
46+
#[arg(short, long)]
4947
pub message: Option<String>,
5048
}
5149

5250
#[derive(Debug, clap::Args)]
5351
pub struct ListArgs {
5452
/// Specify which stash stack to use
55-
#[clap(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
53+
#[arg(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
5654
pub stack: String,
5755
}
5856

5957
#[derive(Debug, clap::Args)]
6058
pub struct ClearArgs {
6159
/// Specify which stash stack to use
62-
#[clap(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
60+
#[arg(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
6361
pub stack: String,
6462
}
6563

6664
#[derive(Debug, clap::Args)]
6765
pub struct DropArgs {
6866
/// Specify which stash stack to use
69-
#[clap(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
67+
#[arg(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
7068
pub stack: String,
7169
}
7270

7371
#[derive(Debug, clap::Args)]
7472
pub struct ApplyArgs {
7573
/// Specify which stash stack to use
76-
#[clap(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
74+
#[arg(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
7775
pub stack: String,
7876
}
7977

0 commit comments

Comments
 (0)