Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ Usage: tk <command> [args]

Commands:
create [title] [options] Create ticket, prints ID
-d, --description Description text
-d, --description Description text, or - to read from stdin
-e, --edit Open editor ($VISUAL or $EDITOR or vi) to edit ticket
--design Design notes
--acceptance Acceptance criteria
-t, --type Type (bug|feature|task|epic|chore) [default: task]
Expand Down
13 changes: 11 additions & 2 deletions ticket
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ cmd_create() {
ensure_dir

local title="" description="" design="" acceptance=""
local priority=2 issue_type="task" assignee="" external_ref="" parent="" tags=""
local priority=2 issue_type="task" assignee="" external_ref="" parent="" tags="" edit=""

# Default assignee to git user.name if available
assignee=$(git config user.name 2>/dev/null || true)
Expand All @@ -175,11 +175,16 @@ cmd_create() {
--external-ref) external_ref="$2"; shift 2 ;;
--parent) parent="$2"; shift 2 ;;
--tags) tags="$2"; shift 2 ;;
-e|--edit) edit=1; shift ;;
-*) echo "Unknown option: $1" >&2; return 1 ;;
*) title="$1"; shift ;;
esac
done

if [[ $description = "-" ]]; then
description="$(< /dev/stdin)"
fi

# Validate and resolve parent if specified
if [[ -n "$parent" ]]; then
local parent_file
Expand Down Expand Up @@ -230,6 +235,10 @@ cmd_create() {
fi
} > "$file"

if [[ $edit = 1 ]]; then
${VISUAL:-${EDITOR:-vi}} "$file"
fi

echo "$id"
}

Expand Down Expand Up @@ -1300,7 +1309,7 @@ Usage: $cmd <command> [args]

Commands:
create [title] [options] Create ticket, prints ID
-d, --description Description text
-d, --description Description text (or "-" to read from stdin)
--design Design notes
--acceptance Acceptance criteria
-t, --type Type (bug|feature|task|epic|chore) [default: task]
Expand Down