3 # Given a Wireshark issue ID, fetch its title and prepare an entry suitable
4 # for pasting into the release notes. Requires curl and jq.
6 # Usage: gen-bugnote <issue number>
8 # Copyright 2013 Gerald Combs
10 # SPDX-License-Identifier: GPL-2.0-or-later
13 gitlab_issue_url_pfx
="https://gitlab.com/api/v4/projects/wireshark%2Fwireshark/issues"
14 issue_id
="${1#\#}" # Strip leading "#"
18 clipboard_cmd
="pbcopy -Pascii"
21 clipboard_cmd
="cat > /dev/clipboard"
24 clipboard_cmd
="xsel --clipboard"
27 echo "Unable to copy to clipboard"
28 clipboard_cmd
="cat > /dev/null"
32 if [ -z "$issue_id" ] ; then
33 echo "Usage: $( basename "$0" ) <issue id>"
38 curl
--silent "${gitlab_issue_url_pfx}/$issue_id" \
39 | jq
--raw-output '.title'
42 issue_title
="${issue_title//\\/\{backslash\}}"
44 if [[ ! ${issue_title: -1} =~
[[:punct
:]] ]] ; then
48 printf "* %s%s wsbuglink:${issue_id}[].\\n" "$issue_title" "$trailing_period" \
51 echo "Copied $issue_id: $issue_title"