GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python-ticket/plugins/ticket-ls at master · sjaandi-project/python-ticket Expand file tree/ Copy pathticket-lsMore file actions executable file ·49 lines (47 loc) · 1.73 KB / Copy pathticket-lsFile metadata and controlsexecutable file ·49 lines (47 loc) · 1.73 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 #!/usr/bin/env bash # tk-plugin: List tickets with optional filters # tk-plugin-version: 1.0.0 set -euo pipefail status_filter="" assignee_filter="" tag_filter="" while [[ $# -gt 0 ]]; do case "$1" in --status=*) status_filter="${1#--status=}"; shift ;; -a) assignee_filter="$2"; shift 2 ;; --assignee=*) assignee_filter="${1#--assignee=}"; shift ;; -T) tag_filter="$2"; shift 2 ;; --tag=*) tag_filter="${1#--tag=}"; shift ;; *) shift ;; esac done awk -v status_filter="$status_filter" -v assignee_filter="$assignee_filter" -v tag_filter="$tag_filter" ' BEGIN { FS=": "; in_front=0 } FNR==1 { if (prev_file) emit() id=""; status=""; title=""; deps=""; assignee=""; tags=""; in_front=0 prev_file=FILENAME } /^---$/ { in_front = !in_front; next } in_front && /^id:/ { id = $2 } in_front && /^status:/ { status = $2 } in_front && /^assignee:/ { assignee = $2 } in_front && /^tags:/ { tags = $2; gsub(/[\[\] ]/, "", tags) } in_front && /^deps:/ { deps = $2 gsub(/[\[\] ]/, "", deps) } !in_front && /^# / && title == "" { title = substr($0, 3) } END { if (prev_file) emit() } function has_tag(tags_str, tag, i, n, arr) { n = split(tags_str, arr, ",") for (i = 1; i <= n; i++) if (arr[i] == tag) return 1 return 0 } function emit() { if (id != "" && (status_filter == "" || status == status_filter) && (assignee_filter == "" || assignee == assignee_filter) && (tag_filter == "" || has_tag(tags, tag_filter))) { deps_display = (deps != "") ? "[" deps "]" : "[]" gsub(/,/, ", ", deps_display) dep_str = (deps_display != "[]") ? " <- " deps_display : "" printf "%-8s [%s] - %s%s\n", id, status, title, dep_str } } ' "$TICKETS_DIR"/*.md 2>/dev/null |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |