bash-completion: make sure that "lastb" actually completes
PATCH 1/1 bash-completion: make sure that "lastb" actually completes
Building util-linux logs a warning on Gentoo:
``` * Problems with installed bash completions were found: * * lastb: incorrect name, no completions for 'lastb' command defined. * * For more details on installing bash-completions, please see: * https://wiki.gentoo.org/wiki/Bash/Installing_completion_files ```
A bash-completion file is usually composed of two parts:
- a function that knows how to produce completions
- a specification of which command should be completed
In cases where multiple commands have the same options, e.g. commands that are symlinked to each other, it is common to symlink the completion files as well. This shares the first part. But the second part cannot be shared, it must be implemented twice by specifying two different commands to be completed.
"lastb" had a symlinked completion, but when the completion system processes /usr/share/bash-completion/completions/lastb, it would only define a completion for "last".
Define both completions in one file, so that sourcing it works regardless of command used.
--- bash-completion/last | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
bash-completion/last +1 -1
@@ -51,4 +51,4 @@ _last_module() COMPREPLY=( $(compgen -u -- $cur) ) return 0 } -complete -F _last_module last +complete -F _last_module last lastb
Signature · 1 line
2.41.0
Quoted 2 lines · Eli Schwartz
bash-completion/last | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com