bd create: support --description=- for stdin input

Allows descriptions with apostrophes and other shell-problematic
characters by reading from stdin. Works with both --description=-
and --body=- (the GitHub CLI-style alias).

Example: echo "It's working" | bd create --title "Test" --description=-

Also fixes pre-existing duplicate pinned column/variable declarations.

Fixes beads-iwi

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-19 01:47:03 -08:00
parent 22f66879aa
commit 02513f1c31
3 changed files with 23 additions and 16 deletions

View File

@@ -36,11 +36,6 @@ func insertIssue(ctx context.Context, conn *sql.Conn, issue *types.Issue) error
pinned = 1
}
pinned := 0
if issue.Pinned {
pinned = 1
}
_, err := conn.ExecContext(ctx, `
INSERT OR IGNORE INTO issues (
id, content_hash, title, description, design, acceptance_criteria, notes,
@@ -100,11 +95,6 @@ func insertIssues(ctx context.Context, conn *sql.Conn, issues []*types.Issue) er
pinned = 1
}
pinned := 0
if issue.Pinned {
pinned = 1
}
_, err = stmt.ExecContext(ctx,
issue.ID, issue.ContentHash, issue.Title, issue.Description, issue.Design,
issue.AcceptanceCriteria, issue.Notes, issue.Status,

View File

@@ -34,8 +34,6 @@ CREATE TABLE IF NOT EXISTS issues (
pinned INTEGER DEFAULT 0,
-- NOTE: replies_to, relates_to, duplicate_of, superseded_by removed per Decision 004
-- These relationships are now stored in the dependencies table
-- Workflow fields
pinned INTEGER DEFAULT 0,
CHECK ((status = 'closed') = (closed_at IS NOT NULL))
);