Open MrMineDe opened 3 weeks ago
Other package managers like apt and dnf use a verbose syntax, mostly/only using words and not flags. I can't imagine implementng that here but I think it would be pretty easy if we did a separate project. In apt, for example, the package lists starts from the fourth argument on:
sudo apt install neovim firefox htop ...
By reading the third argument, you instantly know what mode to set. And you just filter out flags and categories.
You can also check the mode as we do now in pakt-sync. See: 553da73 Here you would define "install" and "remove" and the program automatically searches all arguments for these keywords. But this belongs more in #19 than here
For autocomplete I would opt to ship changed autocomplete scripts from the package managers, that we make compatible with our + functionality, --pakt-help and other potential flags.
I think the simplicity of the +cat syntax makes these changes pretty trivial.
Then at the beginning of the script (if that works) we could load the correct autocomplete file from "PACKAGE_MANAGER" if we have one. Otherwise we could provide a simple one, that only supports our Syntax
Good idea but I don‘t see how pacman‘s autocomplete could work well with apt or dnf 💀. Also, I find the idea of searching for „install“ and „remove“ in all arguments very unreliable since packages can contain these words, e.g. archinstall.
Autocomplete in zsh (probably same as bash) is implemented in pacman. It is probably smart to just take the pacman autocomplete file and change it up a bit. This collides with #2 though, because it will be pretty hard to generate the thing dynamically for all the options set in the config (if we go with that approach). And if we try to generate it dynamically, we cannot take the pacman file as a base...
TLDR; if we want a FULL autocomplete (like pacman) for everything across different package managers, It's going to be pretty hard