Fix create_bead.sh to handle multi-line descriptions properly

- Use proper shift-based parameter handling instead of positional
- Build command string that preserves newlines in description
- Fixes issue where multi-line descriptions were incorrectly parsed as parent-id
This commit is contained in:
Levi Neely 2026-02-28 23:10:57 +01:00
parent 27188f1f55
commit 7a40244663
1 changed files with 16 additions and 6 deletions

View File

@ -15,10 +15,20 @@ if [ $# -lt 2 ]; then
fi
MOUNT="$1"
TITLE="$2"
DESC="${3:-}"
PARENT="${4:-}"
NOLINT="${5:-}"
CAP="${6:-}"
shift
TITLE="$1"
shift
DESC="${1:-}"
[ $# -gt 0 ] && shift
PARENT="${1:-}"
[ $# -gt 0 ] && shift
NOLINT="${1:-}"
[ $# -gt 0 ] && shift
CAP="${1:-}"
printf "new '%s' '%s' %s %s %s\n" "$TITLE" "$DESC" "$PARENT" "$NOLINT" "$CAP" | 9p write agent/beads/$MOUNT/ctl
CMD="new '$TITLE' '$DESC'"
[ -n "$PARENT" ] && CMD="$CMD $PARENT"
[ -n "$NOLINT" ] && CMD="$CMD $NOLINT"
[ -n "$CAP" ] && CMD="$CMD $CAP"
echo "$CMD" | 9p write agent/beads/$MOUNT/ctl