]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
whereis: use commands for Bash completions
authorSmitty <me@smitop.com>
Sun, 8 Aug 2021 22:04:30 +0000 (18:04 -0400)
committerSmitty <me@smitop.com>
Sun, 8 Aug 2021 22:04:30 +0000 (18:04 -0400)
Currently, the Bash completions for `whereis <TAB>` gives
`whereis file` ("file" is not a placeholder here, it literally expands
to that). This fixes that by passing the `-c` flag to `compgen` to
request completions for command names.

Signed-off-by: Smitty van Bodegom <me@smitop.com>
bash-completion/whereis

index 0dcbac35bc56b47fe8ba73105049ae82645fe157..013f68c72d7306679abcae42d261c6f813fb16e8 100644 (file)
@@ -22,7 +22,7 @@ _whereis_module()
                        return 0
                        ;;
        esac
-       COMPREPLY=( $(compgen -W "file" -- $cur) )
+       COMPREPLY=( $(compgen -c -- $cur) )
        return 0
 }
 complete -F _whereis_module whereis