Skip to content

Commit

Permalink
Merge pull request #31 from epage/v4
Browse files Browse the repository at this point in the history
refactor: Upgrade to v4
  • Loading branch information
epage authored Sep 28, 2022
2 parents aaa799a + 7c10288 commit 4edfc12
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 54 deletions.
48 changes: 12 additions & 36 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ documentation = "https://github.com/gitext-rs/git-branch-stash.git"
readme = "README.md"
categories = ["command-line-interface", "development-tools"]
keywords = ["git", "cli"]
edition = "2018"
edition = "2021"
rust-version = "1.60.0" # MSRV
include = [
"src/**/*",
Expand All @@ -39,16 +39,16 @@ path = "src/main.rs"
doc = false

[dependencies]
clap = { version = "3.2", features = ["derive"] }
clap-verbosity-flag = "1.0"
clap = { version = "4.0.0", features = ["derive"] }
clap-verbosity-flag = "2.0"
env_logger = { version = "0.9", default-features = false, features = ["termcolor"] }
log = "0.4"
proc-exit = "1"
eyre = "0.6"
human-panic = "1"
yansi = "0.5.1"
concolor = "0.0.8"
concolor-clap = { version = "0.0.10", features = ["api_unstable"] }
concolor-clap = { version = "0.0.11", features = ["api_unstable"] }

git-branch-stash = { version = "0.8.0", path = "crates/git-branch-stash" }
git2 = { version = "0.14", default-features = false, features = ["vendored-libgit2"] }
Expand Down
26 changes: 12 additions & 14 deletions src/args.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
#[derive(Debug, clap::Parser)]
#[clap(name = "git-branch-stash", about, author, version)]
#[clap(
setting = clap::AppSettings::DeriveDisplayOrder,
dont_collapse_args_in_usage = true,
#[command(name = "git-branch-stash", about, author, version)]
#[command(
args_conflicts_with_subcommands = true,
color = concolor_clap::color_choice(),
)]
pub struct Args {
#[clap(subcommand)]
#[command(subcommand)]
pub subcommand: Option<Subcommand>,

#[clap(flatten)]
#[command(flatten)]
pub push: PushArgs,

#[clap(flatten)]
#[command(flatten)]
pub(crate) color: concolor_clap::Color,

#[clap(flatten)]
#[command(flatten)]
pub verbose: clap_verbosity_flag::Verbosity<clap_verbosity_flag::InfoLevel>,
}

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

/// Annotate the snapshot with the given message
#[clap(short, long)]
#[arg(short, long)]
pub message: Option<String>,
}

#[derive(Debug, clap::Args)]
pub struct ListArgs {
/// Specify which stash stack to use
#[clap(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
#[arg(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
pub stack: String,
}

#[derive(Debug, clap::Args)]
pub struct ClearArgs {
/// Specify which stash stack to use
#[clap(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
#[arg(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
pub stack: String,
}

#[derive(Debug, clap::Args)]
pub struct DropArgs {
/// Specify which stash stack to use
#[clap(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
#[arg(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
pub stack: String,
}

#[derive(Debug, clap::Args)]
pub struct ApplyArgs {
/// Specify which stash stack to use
#[clap(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
#[arg(default_value = git_branch_stash::Stack::DEFAULT_STACK)]
pub stack: String,
}

Expand Down

0 comments on commit 4edfc12

Please sign in to comment.