]> git.phdru.name Git - dotfiles.git/commitdiff
.shellrc: Check completion for `bg`, `fg`, `jobs` and `unset`
authorOleg Broytman <phd@phdru.name>
Mon, 20 Jul 2020 07:44:12 +0000 (10:44 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 20 Jul 2020 07:44:12 +0000 (10:44 +0300)
.shellrc

index 62e1f0bb324cbe0f5851ffd0fe105efe758da45f..a75cae9936255d4771851178e605c6d3ddfdbac5 100644 (file)
--- a/.shellrc
+++ b/.shellrc
@@ -111,6 +111,16 @@ if test -n "$BASH_VERSION"; then
       ! has_completion $cmd && complete -o default -A hostname $cmd
    done
 
       ! has_completion $cmd && complete -o default -A hostname $cmd
    done
 
+   for cmd in bg fg jobs; do
+      ! has_completion $cmd && complete -A job $cmd
+   done
+
+   complete -A job j wait
+
+   for cmd in unset; do
+      ! has_completion $cmd && complete -A variable -A function $cmd
+   done
+
    if [ -d "$HOME"/.bash_completion.d ]; then
       for _compf in "$HOME"/.bash_completion.d/*; do
          . $_compf
    if [ -d "$HOME"/.bash_completion.d ]; then
       for _compf in "$HOME"/.bash_completion.d/*; do
          . $_compf
@@ -139,8 +149,6 @@ if test -n "$BASH_VERSION"; then
    delegate_completion ssh s
    delegate_completion wget wget-m wget-wrapper ww
 
    delegate_completion ssh s
    delegate_completion wget wget-m wget-wrapper ww
 
-   complete -A job bg fg j jobs wait
-   complete -A variable -A function unset
    unset _BASH_COMPLETIONS_DIR has_completion delegate_completion
 
    if [ -d "$HOME/lib/config" ]; then
    unset _BASH_COMPLETIONS_DIR has_completion delegate_completion
 
    if [ -d "$HOME/lib/config" ]; then