Bug 886912 - RFE: bash-completion for dnf
Summary: RFE: bash-completion for dnf
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 18
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2012-12-13 15:03 UTC by Jan Vcelak
Modified: 2013-08-13 15:08 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-08-13 15:08:21 UTC
Type: Bug

Attachments (Terms of Use)

Description Jan Vcelak 2012-12-13 15:03:30 UTC
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 15:34:31 UTC
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 15:56:29 UTC
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 09:53:13 UTC
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 15:07:13 UTC
(not working on this now)

Comment 6 Ales Kozumplik 2013-08-13 15:08:21 UTC
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.