Bug 1135986
| Summary: | RFE: teach bash completion about dnf plugins | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Hans de Goede <hdegoede> |
| Component: | dnf-plugins-core | Assignee: | rpm-software-management |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | low | ||
| Version: | rawhide | CC: | amatej, jzeleny, packaging-team-maint, tim.lauridsen |
| Target Milestone: | --- | Keywords: | FutureFeature, Triaged |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-08-10 05:31:05 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
Hans de Goede
2014-09-01 12:03:21 UTC
I'm re-writing bash-completion from scratch. this functionality will be added. Are we need bash-completion for plugins? or we just need repo<tab><tab> and nothing more for plugins? (In reply to Igor Gnatenko from comment #2) > Are we need bash-completion for plugins? or we just need repo<tab><tab> and > nothing more for plugins? It would be nice if things like: dnf repoquery --what<tab><tab> Would also work, and basically the same for all core plugins. IOW it would ne nice to have full bash completion for commands provided by core plugins, just like the completion for buildins. For repoquery see: http://dnf-plugins-core.readthedocs.org/en/latest/repoquery.html And for the others see: http://dnf-plugins-core.readthedocs.org/en/latest/ Thanks, Hans Igor note that at no cost we can create any kind of a dependency from core dnf to the plugins. If that proves to be the only way then you're welcome to CANTFIX this. Thanks! (In reply to Ales Kozumplik from comment #4) > Igor note that at no cost we can create any kind of a dependency from core > dnf to the plugins. If that proves to be the only way then you're welcome to > CANTFIX this. Thanks! What do you think about this solution? Solution: `dnf.cli.Command` class should have new optional field where we shoud provide initialized `ArgumentParser` class and if we invoke `dnf someplugin help` if this optional field provided we printing this. Or something like that. I had similar thought - implement ArgumentParser's subparser inside each Command. The problem is that DNF would be binded to ArgumentParser module which could be deprecated in feature. By refactoring it we would break all the plugins. I have played around with that, and it gives a lot of issues. multiple plugins can't have the same options and a bad plugin, can stop dnf from working. The current approch used in some plugins with each plugin setup a argument parser to parse the leftover arguments/option given by dnf to the plugin is much better. But it gives som íssues for bash completion for plugins commands (In reply to Martin Kutlak from comment #8) > PR: > https://github.com/rpm-software-management/dnf/pull/1102 Awesome (note not tested) I will be so happy when I can use tab-completion on "dnf repoquery ..." commands :) Thank you for your work on this. The bash completion was improve, therefore closing bug as a resolved. |