Bug 886912

Summary: RFE: bash-completion for dnf
Product: [Fedora] Fedora Reporter: Jan Vcelak <jvcelak>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: akozumpl, ignatenko, rrakus, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-13 15:08:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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):
dnf-0.2.17-1.git6a055e6.fc18.noarch


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.