aboutsummaryrefslogtreecommitdiffstats
path: root/completion/arch-chroot.bash
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-07-03 05:08:22 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-07-03 05:08:22 -0400
commit1907d1037c2e5d98b8b55b563d7b0ce8cd4b408a (patch)
treed704c14acf3b6dd56a482dc30c730aea6eafa734 /completion/arch-chroot.bash
parentad1be39ef1dc25f2fe3a2f41a931d8e734cbeb76 (diff)
parent0d2edecb2be14c0ed92a33c7508358d648cd3d2f (diff)
Update upstream source from tag 'upstream/22'
Update to upstream version '22' with Debian dir 76cf8a8f0842846234438b4170eb5cf1a638e775
Diffstat (limited to 'completion/arch-chroot.bash')
-rw-r--r--completion/arch-chroot.bash27
1 files changed, 27 insertions, 0 deletions
diff --git a/completion/arch-chroot.bash b/completion/arch-chroot.bash
new file mode 100644
index 0000000..37fbf7c
--- /dev/null
+++ b/completion/arch-chroot.bash
@@ -0,0 +1,27 @@
+_arch_chroot() {
+ compopt +o dirnames
+ local cur prev opts
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ opts="-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