-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bash-completion for core plugins (RhBug: 1135986) (RhBug:1425812) #1102
Add bash-completion for core plugins (RhBug: 1135986) (RhBug:1425812) #1102
Conversation
https://bugzilla.redhat.com/show_bug.cgi?id=1425812 Signed-off-by: Martin Kutlak <[email protected]>
Signed-off-by: Martin Kutlak <[email protected]>
Signed-off-by: Martin Kutlak <[email protected]>
Signed-off-by: Martin Kutlak <[email protected]>
Signed-off-by: Martin Kutlak <[email protected]>
Signed-off-by: Martin Kutlak <[email protected]>
Signed-off-by: Martin Kutlak <[email protected]>
Signed-off-by: Martin Kutlak <[email protected]>
Signed-off-by: Martin Kutlak <[email protected]>
Signed-off-by: Martin Kutlak <[email protected]>
Signed-off-by: Martin Kutlak <[email protected]>
Why aren't these being added to dnf-plugins-core instead? I'd rather have a way for our completion mechanism to easily hooked with more plugin completions. |
@mkutlak looks good, thanks for the PR. However, it really should go into the dnf-plugins-core package. The obvious handwavy solution is to add a dnf-plugins-core bashcomp file and look for it in the dnf bashcomp file. If present, it should be hooked into the _dnf() function. Are you interested in doing this? |
Also:
How exactly does this work? No explicit check is present in the commits and it's not obvious to me. |
I am no longer interested in this.
Apologies, it should say from _dnf_commands_helper()
helper_cmd="import sys; from dnf.cli import completion_helper as ch; ch.main(sys.argv[1:])" This returns a list of all available If you have With $ echo "$(python3 -c "import sys; from dnf.cli import completion_helper as ch; ch.main(sys.argv[1:])" "_cmds" "" "-d 0 -q -C --assumeno --nogpgcheck")" |wc -l
92 Without $ echo "$(python3 -c "import sys; from dnf.cli import completion_helper as ch; ch.main(sys.argv[1:])" "_cmds" "" "-d 0 -q -C --assumeno --nogpgcheck")" |wc -l
75 |
@mkutlak ok, thanks. Not sure what to do with this PR then. The commits are valuable but need the work of moving them to dnf-plugins-core and integrating with dnf bash completion. I'm inclined to leave this open until someone gets around to do this. |
I would like to have all options / parameters of dnf commands generated by the argparse python module. I mark this as "work in progress" for now. |
Because it's hard to implement plugins in bash, maybe we will use python to implement autocomplete? |
The completions are only shown if the
python3-dnf-plugins-core
is installed.https://bugzilla.redhat.com/show_bug.cgi?id=1135986
https://bugzilla.redhat.com/show_bug.cgi?id=1425812