fish-shell icon indicating copy to clipboard operation
fish-shell copied to clipboard

completions/apt improvements and additions for apt completions

Open nicole-jf opened this issue 5 months ago • 1 comments

  • completions/apt.fish: add completions for history related sub-commands of apt that were added in apt version 3.0
  • completions/apt.fish: add completion for the comment option for the sub-commands where it is applicable
  • completions/apt.fish: add completion for why and why-not sub-commands
  • completions/apt.fish: add and change which sub-commands get completions for installed or all packages
  • completions/apt.fish: add support for new source list format (currently incomplete)

TODOs:

  • [x] If addressing an issue, a commit message mentions Fixes issue #<issue-number>
  • [x] Changes to fish usage are reflected in user documentation/manpages.
  • [x] Tests have been added for regressions fixed
  • [x] User-visible changes noted in CHANGELOG.rst
  • [x] Complete support for new source list format, ~~does not support multiple suites in one definition~~ the 5th commit fixes this

nicole-jf avatar Jun 23 '26 20:06 nicole-jf

I am considering just simply not supporting multiple suites in one definition, for better context I will give an example of the of the sources list format:

/etc/apt/sourceslists.d/foo.sources

# Example comment
Types: deb deb-src
URIs: https://deb.debian.org/debian/
Suites: sid experimental
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

The Suites: section can have multiple values and from my testing apt does seem to work and understand them, in this case thoese values are sid and experimental but I think it is more common to users to define those in separated files

then you would have:

/etc/apt/sourceslists.d/bar.sources

# Example comment
Types: deb deb-src
URIs: https://deb.debian.org/debian/
Suites: sid
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

/etc/apt/sourceslists.d/baz.sources

# Example comment
Types: deb deb-src
URIs: https://deb.debian.org/debian/
Suites: experimental
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

in this case the completions for repositories work fine in my testing

nicole-jf avatar Jun 27 '26 20:06 nicole-jf

maybe we can outsource the source-list parsing to apt or to a python library?

krobelus avatar Jul 04 '26 10:07 krobelus