Results 1 to 8 of 8

Thread: Fix zypper completion in fish (shell)

  1. #1

    Default Fix zypper completion in fish (shell)

    So I've been playing around with some alternatives shells and I have just about settled on fish. My only issues are with completion for zypper. Specifically it doesn't pull package​ names while bash does. Is there any way to get fish to properly complete for zypper?

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,864
    Blog Entries
    15

    Default Re: Fix zypper completion in fish (shell)

    Hi
    It's present, probably in /usr/share/completions?
    https://github.com/fish-shell/fish-s...ns/zypper.fish

    Copy it over (or source it) to ~./config/fish/completions
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3

    Default Re: Fix zypper completion in fish (shell)

    Quote Originally Posted by malcolmlewis View Post
    Hi
    It's present, probably in /usr/share/completions?
    https://github.com/fish-shell/fish-s...ns/zypper.fish

    Copy it over (or source it) to ~./config/fish/completions
    Thanks, but I do have basic completion of commands (though it's missing some options like --no-allow-vendor-change) but I'm specifically talking about completing package names for removal/installation like bash does. fish does this on other systems (such as Debian with apt and Manjaro with pacman).

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,864
    Blog Entries
    15

    Default Re: Fix zypper completion in fish (shell)

    Quote Originally Posted by raptir View Post
    Thanks, but I do have basic completion of commands (though it's missing some options like --no-allow-vendor-change) but I'm specifically talking about completing package names for removal/installation like bash does. fish does this on other systems (such as Debian with apt and Manjaro with pacman).
    Hi
    So looking at the zypper.fish file it needs some additional switches added for example for vendor change in the dup section add;

    Code:
    complete -c zypper -n '__fish_zypper_is_subcommand_dup' -l no-allow-vendor-change        --description 'Whether to allow changing the vendor of installed resolvables'
    I did this in /root/.config/fish/completions/zypper.fish copied from the user share one, make changes, test and be a good oss user and push the changes upstream

    I see completion in fish with the rm command if push tab twice (to show the list)?

    Code:
    zypper in pit<tab tab>
    pithos  (Package)  pitivi  (Package)  pitivi-lang  (Package)
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5

    Default Re: Fix zypper completion in fish (shell)

    Thanks! That got me to the solution, though I don't quite understand it. I had created a completion file just to add the --no-allow-vendor-change option. I assumed it was appending it to the existing completions because all of the other command completions were still working, but apparently it was breaking this functionality. I removed my custom completion file and while --no-allow-vendor-change is not present it's fixed the package name completion. I'll try copying the full file and adding --no-allow-vendor-change and see if that works.

    Edit: I pulled the full file into my home directory and added the no-allow-vendor-change option and it works great. I would love to submit this fix but to be honest I don't really know how to contribute to a project like that.

  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,864
    Blog Entries
    15

    Default Re: Fix zypper completion in fish (shell)

    Quote Originally Posted by raptir View Post
    Thanks! That got me to the solution, though I don't quite understand it. I had created a completion file just to add the --no-allow-vendor-change option. I assumed it was appending it to the existing completions because all of the other command completions were still working, but apparently it was breaking this functionality. I removed my custom completion file and while --no-allow-vendor-change is not present it's fixed the package name completion. I'll try copying the full file and adding --no-allow-vendor-change and see if that works.

    Edit: I pulled the full file into my home directory and added the no-allow-vendor-change option and it works great. I would love to submit this fix but to be honest I don't really know how to contribute to a project like that.
    Hi
    You can just login to the github project and raise an issue with the suggested addition to the file (zypper.fish) just as you tested.

    Ask to add;
    Code:
    complete -c zypper -n '__fish_zypper_is_subcommand_dup' -l no-allow-vendor-change        --description 'Whether to allow changing the vendor of installed resolvables'
    There are probably more if you run the command;
    Code:
    zypper dup --help
    However, the developer may have omitted the 'expert commands' on purpose. In this case specify it's the recommended openSUSE option to update on Tumbleweed so could be considered and exception...
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #7

    Default Re: Fix zypper completion in fish (shell)

    Thanks, I went ahead and submitted the pull request including some info about how it is recommended for Tumbleweed.

  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,864
    Blog Entries
    15

    Default Re: Fix zypper completion in fish (shell)

    Quote Originally Posted by raptir View Post
    Thanks, I went ahead and submitted the pull request including some info about how it is recommended for Tumbleweed.
    Hi
    Awesome, hopefully it won't take long to get accepted and an update released so can be included.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •