summaryrefslogtreecommitdiffstats
path: root/vendor/clap/examples/git-derive.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
commit631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch)
treea1b87c8f8cad01cf18f7c5f57a08f102771ed303 /vendor/clap/examples/git-derive.rs
parentAdding debian version 1.69.0+dfsg1-1. (diff)
downloadrustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz
rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/clap/examples/git-derive.rs')
-rw-r--r--vendor/clap/examples/git-derive.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/vendor/clap/examples/git-derive.rs b/vendor/clap/examples/git-derive.rs
index 519982d1b..ad82e0cea 100644
--- a/vendor/clap/examples/git-derive.rs
+++ b/vendor/clap/examples/git-derive.rs
@@ -53,7 +53,7 @@ enum Commands {
#[arg(required = true)]
path: Vec<PathBuf>,
},
- Stash(Stash),
+ Stash(StashArgs),
#[command(external_subcommand)]
External(Vec<OsString>),
}
@@ -76,23 +76,23 @@ impl std::fmt::Display for ColorWhen {
#[derive(Debug, Args)]
#[command(args_conflicts_with_subcommands = true)]
-struct Stash {
+struct StashArgs {
#[command(subcommand)]
command: Option<StashCommands>,
#[command(flatten)]
- push: StashPush,
+ push: StashPushArgs,
}
#[derive(Debug, Subcommand)]
enum StashCommands {
- Push(StashPush),
+ Push(StashPushArgs),
Pop { stash: Option<String> },
Apply { stash: Option<String> },
}
#[derive(Debug, Args)]
-struct StashPush {
+struct StashPushArgs {
#[arg(short, long)]
message: Option<String>,
}
@@ -102,7 +102,7 @@ fn main() {
match args.command {
Commands::Clone { remote } => {
- println!("Cloning {}", remote);
+ println!("Cloning {remote}");
}
Commands::Diff {
mut base,
@@ -136,22 +136,22 @@ fn main() {
);
}
Commands::Push { remote } => {
- println!("Pushing to {}", remote);
+ println!("Pushing to {remote}");
}
Commands::Add { path } => {
- println!("Adding {:?}", path);
+ println!("Adding {path:?}");
}
Commands::Stash(stash) => {
let stash_cmd = stash.command.unwrap_or(StashCommands::Push(stash.push));
match stash_cmd {
StashCommands::Push(push) => {
- println!("Pushing {:?}", push);
+ println!("Pushing {push:?}");
}
StashCommands::Pop { stash } => {
- println!("Popping {:?}", stash);
+ println!("Popping {stash:?}");
}
StashCommands::Apply { stash } => {
- println!("Applying {:?}", stash);
+ println!("Applying {stash:?}");
}
}
}