Skip to content

Commit

Permalink
autocomplete: support bash autocomplete on apt
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Jul 28, 2023
1 parent f58088f commit a6a2d11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions commands/setup-util-bash
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function setup-util-bash() (
ZYPPER='bash'

# no need to do fancy checks, as there is no failure if it is already present
# https://github.com/scop/bash-completion
setup-util "${args[@]}" --optional --no-fallback --name='Bash Completions' \
APK='bash-completion' \
APT='bash-completion' \
Expand Down
4 changes: 3 additions & 1 deletion sources/autocomplete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ if test "${AUTOCOMPLETE_BASH-}" != 'no' -a "$ACTIVE_SHELL" = 'bash'; then
. '/etc/bash_completion'
fi

# load homebrew completions
# load installed bash-completions
if test -n "${HOMEBREW_PREFIX-}" -a -f "${HOMEBREW_PREFIX-}/etc/bash_completion"; then
. "$HOMEBREW_PREFIX/etc/bash_completion"
elif test -f '/etc/profile.d/bash_completion.sh'; then
. '/etc/profile.d/bash_completion.sh'
fi
fi

Expand Down

0 comments on commit a6a2d11

Please sign in to comment.