Skip to content

Commit

Permalink
Merge pull request #4 from hankei6km/topic/suppport-issue
Browse files Browse the repository at this point in the history
Support "issue" command
  • Loading branch information
hankei6km authored Jan 24, 2022
2 parents 7e4afb4 + 1e247cf commit 57a5b65
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion gh-label-completion
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,26 @@ __gh_label_completion() {
local cur prev words
_init_completion -s || return

if [ "${words[1]}" = "pr" ]; then
if [ "${words[1]}" = "issue" ]; then
if [ "${words[2]}" = "create" ] || [ "${words[5]}" = "create" ] || \
[ "${words[2]}" = "list" ] || [ "${words[5]}" = "list" ]; then
case "${prev}" in
-l | --label)
__gh_label_completion_labels_from_repo
return
;;
esac

elif [ "${words[2]}" = "edit" ] || [ "${words[5]}" = "edit" ]; then
case "${prev}" in
--add-label)
__gh_label_completion_labels_from_repo
return
;;
esac
fi

elif [ "${words[1]}" = "pr" ]; then
if [ "${words[2]}" = "create" ] || [ "${words[5]}" = "create" ] || \
[ "${words[2]}" = "list" ] || [ "${words[5]}" = "list" ]; then
case "${prev}" in
Expand Down

0 comments on commit 57a5b65

Please sign in to comment.