Of note: The rpm/yum thing seems to be coupled, so I put it into one
function that tries the yum helper and uses the rpm path otherwise.
Zypper is already its own thing, so this should only be used for yum
and probably dnf (does that still have the helper?)
Zypper can be dropped, as that already used a separate function in the file.
Apk can just be inlined - it's literally one line for installed and another for all packages.
This function doesn't make any sense.
Most things that expect package names expect package names for *one
specific package manager*.
It only happens to work, most of the time, because most people only
have one package manager installed.
* Update apk-tools completions
Add completions of options of it's subcommands.
The completions of deprecated options is unimplemented.
* Fix installed package listing for apk-tools
An error occurs when the local cache does not exist, so fixed this.
On my system this printed just "Description:" without any additional
characters, so this awkward `sed` didn't match and produced *all
packages on one line*.
Tbh this should probably be rewritten, but first we'd have to find a
way to get proper output here.
Add completions for `downgrade` tool
Add new `--installed` option for printing Arch packages
Change Arch Linux package related completions to use `--installed`
add newline
This runs build_tools/style.fish, which runs clang-format on C++, fish_indent on fish and (new) black on python.
If anything is wrong with the formatting, we should fix the tools, but automated formatting is worth it.
Use `apt-cache show` instead of `apt-cache packagenames` to efficiently
print package names and a brief description instead of the placeholder
(localized) "Package" text that was previously printed. This applies to
both available and installed packages (for inistall and remove operations,
respectively).
TODO: update `__fish_print_packages` for non-debian platforms to do the
same.
When listing packages already installed (e.g. for use with `apt remove
...`), do not consider packages return by `dpkg --get-selections` with
state 'deinstall'.
Previously the `string replace` pattern was matching both 'install' and
'deinstall' packages.
Utilized the `--install` flag added in commit #8c09d6e.
Limit `eopkg remove/autoremove/check ...` completions to installed packages.
Limit `eopkg install/upgrade/info ...` completions to available packages.
Added a new flag `--installed` via `argparse` to `__fish_print_packages`
which indicates that only installed packages should be listed.
TODO: Other non-debian/apt platforms should take advantage of this flag/
behavior as well.
* Add eopkg support
Add support for eopkg in __fish_print_packages function, and
add new completion eopkg.fish in share/completions
* Sorry for the empty file
* Sorry for the empty file again
* Use builtin function for checking subcommand and options
* Fix description
* Use string function to replace grep and cut
* Add completion for search command
Using bare vars is more efficient because it makes the builtin `math`
expression cache more useful. That's because if you prefix each var with
a dollar-sign then the fish parser expands it before `math` is run.
Something like `math x + 1` can be cached since the expression is the
same each time it is run. But if you do `math $x + 1` and x==1 then you're
effectively executing `math 1 + 1`. And if x==2 the next time then you're
running `math 2 + 1`. Which makes the expression cache much less effective.
I hate doing this but I am tired of touching a fish script as part of
some change and having `make style` radically change it. Which makes
editing fish scripts more painful than it needs to be. It is time to do
a wholesale reformatting of these scripts to conform to the documented
style as implemented by the `fish_indent` program.
* use $XDG_CACHE_HOME for __fish_print_packages completion caches
* when starting fishd, redirect fishd output to /dev/null, not a
predictable path
Fix for CVE-2014-3219.
Closes#1440.
Closes#479 by piping STDERR to /dev/null.
Also does much less manipulation of the package list; there are no
packages in any of the archives containing the names that are stripped
out as far as I can see.
* Added FreeBSD's pkg to __fish_print_packages
* Portmaster completes on installed packages and ports
* Options list as per fish_generate_completions, needs to be tidied
up further but will suffice for now
On Gentoo the eix program is MUCH faster than emerge for listing package
names. I've left the emerge code in as a 2nd choice because not every
Gentoo system has eix installed (although they should). Also, the
emerge code didn't seem to produce any output on my system.
Signed-off-by: Grissiom <chaos.proton@gmail.com>