future-install-scripts/completion/arch-chroot.bash
Sean Anderson 2623f8d76f Add unshare mode to arch-chroot
This is effectively the same transformation as in the previous patch.
We move the mountpoint warning later to avoid warning when we are about
to bind-mount the chroot dir ourselves.
2021-12-08 17:49:09 -05:00

26 lines
502 B
Bash

_arch_chroot() {
compopt +o dirnames
local cur prev opts i
_init_completion -n : || return
opts="-N -u -h"
for i in "${COMP_WORDS[@]:1:COMP_CWORD-1}"; do
if [[ -d ${i} ]]; then
return 0
fi
done
if [[ ${prev} = -u ]]; then
_usergroup -u
return 0
fi
if [[ ${cur} = -* ]]; then
COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
return 0
fi
compopt -o dirnames
}
complete -F _arch_chroot arch-chroot