From 55b493b06567c3b6e5322950277d907b8d2d7528 Mon Sep 17 00:00:00 2001 From: Anton Konyahin Date: Thu, 12 Feb 2026 08:58:28 +0300 Subject: [PATCH] feat: multi-word title support for tk create command --- CHANGELOG.md | 1 + features/ticket_creation.feature | 12 ++++++++++++ ticket | 7 ++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86c4d2db..f566e553 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Plugin metadata: `# tk-plugin:` comment for scripts, `--tk-describe` flag for binaries - Multi-package distribution: `ticket-core`, `ticket-extras`, and individual plugin packages - CI scripts for publishing to Homebrew tap and AUR +- Multi-word title support for `tk create` command ## [0.3.2] - 2026-02-03 diff --git a/features/ticket_creation.feature b/features/ticket_creation.feature index 7cc07768..2de3dd09 100644 --- a/features/ticket_creation.feature +++ b/features/ticket_creation.feature @@ -18,6 +18,12 @@ Feature: Ticket Creation And the output should match a ticket ID pattern And a ticket file should exist with title "Untitled" + Scenario: Create a basic ticket with multi-word title + When I run "ticket create My first multi-word ticket" + Then the command should succeed + And the output should match a ticket ID pattern + And a ticket file should exist with title "My first multi-word ticket" + Scenario: Create a ticket with description When I run "ticket create 'Test ticket' -d 'This is the description'" Then the command should succeed @@ -28,6 +34,12 @@ Feature: Ticket Creation Then the command should succeed And the created ticket should have field "type" with value "bug" + Scenario: Create a ticket with multi-word title and type + When I run "ticket create Chore ticket -t chore" + Then the command should succeed + And a ticket file should exist with title "Chore ticket" + And the created ticket should have field "type" with value "chore" + Scenario: Create a ticket with priority When I run "ticket create 'High priority' -p 0" Then the command should succeed diff --git a/ticket b/ticket index 1dedcec0..11eebde4 100755 --- a/ticket +++ b/ticket @@ -157,7 +157,8 @@ ${field}: ${value} cmd_create() { ensure_dir - local title="" description="" design="" acceptance="" + local title_args=() + local description="" design="" acceptance="" local priority=2 issue_type="task" assignee="" external_ref="" parent="" tags="" # Default assignee to git user.name if available @@ -176,7 +177,7 @@ cmd_create() { --parent) parent="$2"; shift 2 ;; --tags) tags="$2"; shift 2 ;; -*) echo "Unknown option: $1" >&2; return 1 ;; - *) title="$1"; shift ;; + *) title_args+=("$1"); shift;; esac done @@ -187,7 +188,7 @@ cmd_create() { parent=$(basename "$parent_file" .md) fi - title="${title:-Untitled}" + title="${title_args[*]:-Untitled}" local id id=$(generate_id) local file="$TICKETS_DIR/${id}.md"