diff options
Diffstat (limited to 'misc/bash_completion')
-rw-r--r-- | misc/bash_completion/git-bug | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/misc/bash_completion/git-bug b/misc/bash_completion/git-bug index a062bfe8..bbebd28f 100644 --- a/misc/bash_completion/git-bug +++ b/misc/bash_completion/git-bug @@ -39,6 +39,7 @@ __git-bug_contains_word() __git-bug_handle_reply() { __git-bug_debug "${FUNCNAME[0]}" + local comp case $cur in -*) if [[ $(type -t compopt) = "builtin" ]]; then @@ -50,7 +51,9 @@ __git-bug_handle_reply() else allflags=("${flags[*]} ${two_word_flags[*]}") fi - COMPREPLY=( $(compgen -W "${allflags[*]}" -- "$cur") ) + while IFS='' read -r comp; do + COMPREPLY+=("$comp") + done < <(compgen -W "${allflags[*]}" -- "$cur") if [[ $(type -t compopt) = "builtin" ]]; then [[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace fi @@ -100,10 +103,14 @@ __git-bug_handle_reply() if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then completions+=("${must_have_one_flag[@]}") fi - COMPREPLY=( $(compgen -W "${completions[*]}" -- "$cur") ) + while IFS='' read -r comp; do + COMPREPLY+=("$comp") + done < <(compgen -W "${completions[*]}" -- "$cur") if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then - COMPREPLY=( $(compgen -W "${noun_aliases[*]}" -- "$cur") ) + while IFS='' read -r comp; do + COMPREPLY+=("$comp") + done < <(compgen -W "${noun_aliases[*]}" -- "$cur") fi if [[ ${#COMPREPLY[@]} -eq 0 ]]; then @@ -138,7 +145,7 @@ __git-bug_handle_filename_extension_flag() __git-bug_handle_subdirs_in_dir_flag() { local dir="$1" - pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 + pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return } __git-bug_handle_flag() @@ -412,10 +419,10 @@ _git-bug_bridge_configure() two_word_flags+=("--base-url") two_word_flags+=("-b") local_nonpersistent_flags+=("--base-url=") - flags+=("--owner=") - two_word_flags+=("--owner") - two_word_flags+=("-o") - local_nonpersistent_flags+=("--owner=") + flags+=("--login=") + two_word_flags+=("--login") + two_word_flags+=("-l") + local_nonpersistent_flags+=("--login=") flags+=("--credential=") two_word_flags+=("--credential") two_word_flags+=("-c") @@ -425,6 +432,10 @@ _git-bug_bridge_configure() local_nonpersistent_flags+=("--token=") flags+=("--token-stdin") local_nonpersistent_flags+=("--token-stdin") + flags+=("--owner=") + two_word_flags+=("--owner") + two_word_flags+=("-o") + local_nonpersistent_flags+=("--owner=") flags+=("--project=") two_word_flags+=("--project") two_word_flags+=("-p") |