Bug 886912 - RFE: bash-completion for dnf
RFE: bash-completion for dnf
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-12-13 10:03 EST by Jan Vcelak
Modified: 2013-08-13 11:08 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-13 11:08:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Vcelak 2012-12-13 10:03:30 EST
Description of problem:
Please, provide bash completion configuration for Dnf. Yum has it. ;-)

Version-Release number of selected component (if applicable):

Workaround if yum completion is available:
$ complete -F _yum -o filenames dnf
Comment 1 Ales Kozumplik 2012-12-13 10:34:31 EST
Thanks for the report.

It's true that bash completion has been dropped from DNF for now: one problem is that there's quite a large cost of loading the package database with libsolv, which is typically balanced by fast querying/depsolving during a typical DNF run. In case of bash completion however we'd only use it to fetch provide names and then throw away: there would be some delay (2 or 3 seconds) after pressing <tab> before seeing the shell react with possible completions.

Workarounds I can think of are all hackish: have a stripped down version of the libsolv cache specifically for this purpose, or maybe generate a text file with a list of provides.

Either way, this is definitely coming much later.
Comment 2 Roman Rakus 2012-12-13 10:56:29 EST
I will add my 2 cents;
completions for options and commands are good things. However I don't think it is a good thing for package names completions. One reason is that it takes a lot of time. Another reason would be memory consumption.
I can imagine a situation where bash will go out of memory, but ok, most probably there will not be millions of packages...
Comment 3 Jan Vcelak 2012-12-17 04:53:13 EST
I agree with Roman. I often happen to initiate package name completion by mistake, then you have to wait or press ^C and write the whole command again. There could be an environmental variable to change this behavior.
Comment 5 Ales Kozumplik 2013-08-13 11:07:13 EDT
(not working on this now)
Comment 6 Ales Kozumplik 2013-08-13 11:08:21 EDT
Hm, OTOH, the solution is hackish, not very useful and the job is not planned. I'm closing this.

Note You need to log in before you can comment on or make changes to this bug.