26 lines
713 B
Bash
Executable File
26 lines
713 B
Bash
Executable File
#!/bin/bash
|
|
# wq_list — list work items with optional filters
|
|
|
|
wq_list() {
|
|
local status agent project_id since qs="?"
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
case "$1" in
|
|
--status) status="$2"; shift 2;;
|
|
--agent) agent="$2"; shift 2;;
|
|
--project-id) project_id="$2"; shift 2;;
|
|
--since) since="$2"; shift 2;;
|
|
--) shift; break;;
|
|
-*) echo "Unknown option: $1" >&2; exit 1;;
|
|
*) echo "Unknown arg: $1" >&2; exit 1;;
|
|
esac
|
|
done
|
|
|
|
[[ -n "$status" ]] && qs="${qs}status=$status&"
|
|
[[ -n "$agent" ]] && qs="${qs}agent=$agent&"
|
|
[[ -n "$project_id" ]] && qs="${qs}project_id=$project_id&"
|
|
[[ -n "$since" ]] && qs="${qs}since=$since&"
|
|
|
|
curl -sf "$API_URL/work${qs}" | jq .
|
|
}
|