From 7db0c5ded40a595c7238a980cd1442299e02157e Mon Sep 17 00:00:00 2001 From: "Alexis (Poliorcetics) Bourget" Date: Mon, 12 Feb 2024 23:27:57 +0100 Subject: [PATCH] feat(cli): Add -f/-t for --from/--to to `jj move` --- CHANGELOG.md | 2 ++ cli/src/commands/move.rs | 4 ++-- cli/tests/cli-reference@.md.snap | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c141d4ab30b..2845395b053 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * `jj git fetch` now automatically prints new remote branches and tags by default. +* `jj move --from/--to` can now be abbreviated to `jj move -f/-t` + ### Fixed bugs * On Windows, symlinks in the repo are now materialized as regular files in the diff --git a/cli/src/commands/move.rs b/cli/src/commands/move.rs index 59e18bb6103..61f76b03f22 100644 --- a/cli/src/commands/move.rs +++ b/cli/src/commands/move.rs @@ -38,10 +38,10 @@ use crate::ui::Ui; #[command(group(ArgGroup::new("to_move").args(&["from", "to"]).multiple(true).required(true)))] pub(crate) struct MoveArgs { /// Move part of this change into the destination - #[arg(long)] + #[arg(long, short)] from: Option, /// Move part of the source into this change - #[arg(long)] + #[arg(long, short)] to: Option, /// Interactively choose which parts to move #[arg(long, short)] diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index 8e11a0256f8..2d03aff6929 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -1057,8 +1057,8 @@ If the source became empty and both the source and destination had a non-empty d ###### **Options:** -* `--from ` — Move part of this change into the destination -* `--to ` — Move part of the source into this change +* `-f`, `--from ` — Move part of this change into the destination +* `-t`, `--to ` — Move part of the source into this change * `-i`, `--interactive` — Interactively choose which parts to move Possible values: `true`, `false`