Currently the foundation for a new fuller argument parsing has been implemented in
parser.go. Most of the parsing is now done through the argParser object
instead of seperate arrays for options and packages. The rest of the
code still expects the old system so I have left most of the operations
unimplemented for now until I redo it with the new system. Currently
only '-S' and number menu have any functionality for testing purposes.
This new system parses arguments fully instead of just looking for
predefined strings such as:
'-Sqi' '-Siq'.
This allows:
'-Syu', '-S -y -u', '--sync -y -u'
to all be parsed as the same.
This system tries to be as similar to pacman as possible, eventually
aming to fully wrap pacman, allowing yay to be used instead of pacman in
all instances.
The current implementation is not as strict as pacman when checking
arguments. If you pass
--someinvalidflag to yay then yay will simply ignore it. The flag should
still be passed to pacman which should then cause an error.
Although operations '-S' '-R' '-U' ect. are checked to make sure you can not
try to use two operations at once.
conflicting flags such as:
'--quiet' and '--info'
will not raise an error and which options gains precedence is depend on
the implementation.
Another minor issue which is worth noting is. Due to the way double
arguments are parsed:
'-dd' '-cc' '--deps --deps'
if you pass the long version and the short version:
'-d --deps'
yay will not realize its a double argument. Meanwhile pacman will
reconise it when yay calls pacman.
Currently there are a few things that need to be done before this new
system can be fuly released:
Reimplement all operations to use to new parsing system so that
the new system is at least as functional as the old one
Strip yay specific flags before passing them to pacman
Move parts of config into the argument system and only use
config for options that are meant to be saved to disk
Move yay specific operations into its own operator '-Y'
Update documentation to show the altered syntax