]> git.ipfire.org Git - thirdparty/util-linux.git/commit
bash-completion: make sure that "lastb" actually completes
authorEli Schwartz <eschwartz93@gmail.com>
Thu, 7 Dec 2023 00:40:44 +0000 (19:40 -0500)
committerKarel Zak <kzak@redhat.com>
Fri, 8 Dec 2023 11:44:48 +0000 (12:44 +0100)
commitfaa07b67e66a9a61ca8ec0157d12760347c71fff
treef2d9db2eaa554a113eb5f37cc66092fdf4342891
parent9be4122b1d8c1c2b8eb270998838c73bae7ff2ff
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