aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/sudo.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-06-12 14:29:30 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-06-12 14:29:30 +1200
commit07ed5d36387bcec7adb07af862c99a2316e3e438 (patch)
tree0f6342a33ad39291652d4b0b9023808c6e1b4add /bash/bashrc.d/sudo.bash
parentRemove unneeded quotes (diff)
downloaddotfiles-07ed5d36387bcec7adb07af862c99a2316e3e438.tar.gz
dotfiles-07ed5d36387bcec7adb07af862c99a2316e3e438.zip
Remove sudo(8)/sudoedit(8) completion
This was a bad idea. Completes commands for every argument, and will complete with users for the command to be run by sudo(8), not just sudo(8) itself. I'd have to tell the function too much about sudo(8)'s grammar to make this reliable.
Diffstat (limited to 'bash/bashrc.d/sudo.bash')
-rw-r--r--bash/bashrc.d/sudo.bash26
1 files changed, 0 insertions, 26 deletions
diff --git a/bash/bashrc.d/sudo.bash b/bash/bashrc.d/sudo.bash
index df2abcc1..41a97a9e 100644
--- a/bash/bashrc.d/sudo.bash
+++ b/bash/bashrc.d/sudo.bash
@@ -7,29 +7,3 @@ sudo() {
fi
}
-# Some imperfect but mostly-useful sudo(8) completion
-_sudo() {
- word=${COMP_WORDS[COMP_CWORD]}
- prev=${COMP_WORDS[COMP_CWORD-1]}
-
- # Completion for this word depends on the previous word
- case $prev in
-
- # If the previous word was an option for -g, complete with group names
- -*g)
- COMPREPLY=( $(compgen -A group -- "$word") )
- ;;
-
- # If the previous word was an option for -u, complete with user names
- -*u)
- COMPREPLY=( $(compgen -A user -- "$word") )
- ;;
-
- # Otherwise complete with commands
- *)
- COMPREPLY=( $(compgen -A command -- "$word") )
- ;;
- esac
-}
-complete -F _sudo -o default sudo
-