From 843c51e347764b5dcb5b56f041f3393ba68f9c0a Mon Sep 17 00:00:00 2001 From: Rogee Date: Fri, 31 Oct 2025 15:29:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=8F=92=E5=85=A5?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E4=BB=A5=E6=94=AF=E6=8C=81=E5=B0=BE=E9=83=A8?= =?UTF-8?q?=E5=81=8F=E7=A7=BB=E6=A0=87=E8=AE=B0=E5=92=8C=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- cmd/insert.go | 4 +- docs/cli-flags.md | 7 ++- internal/insert/positions.go | 43 +++++++++++++++-- specs/005-add-insert-command/quickstart.md | 4 +- specs/005-add-insert-command/spec.md | 8 ++-- tests/contract/insert_command_test.go | 56 ++++++++++++++++++++++ tests/contract/insert_ledger_test.go | 46 ++++++++++++++++++ tests/integration/insert_flow_test.go | 24 ++++++++++ 9 files changed, 178 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index bcf0d9a..780269d 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ All subcommands accept these persistent flags: - `renamer replace ` — Replace multiple literal tokens in sequence. Shows duplicates and conflict warnings, then applies when `--yes` is present. - `renamer remove ` — Strip ordered substrings from names with empty-name protection and duplicate detection. - `renamer extension ` — Normalize heterogeneous extensions to a single target while keeping a ledger entry for undo. -- `renamer insert ` — Insert text at symbolic (`^`, `$`) or numeric offsets (positive or negative). +- `renamer insert ` — Insert text at symbolic (`^`, `$`) offsets, count forward with numbers (`3` or `^3`), or backward with suffix tokens like `1$`. - `renamer regex