From b533cdc53837040fec33eeebcf36de3ac1404a00 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 47b8bebf5..ca1bfa654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * `--verbose/-v` is now `--debug` (no short option since it's not intended to be used often) +* `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 59e18bb61..61f76b03f 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 5a4274d17..e40ebb4cb 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`