Fixed command line options parsing #139
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On LMDE6, I have backports configured. I noticed that
apt -t bookworm-backports install qemu
fails with a strange looking error:This boils down to how
/usr/local/bin/apt
is parsing command line options. In above example, that Python code makes a good effort in switching the-t
withinstall
but that leaves the system withapt install bookworm-backports -t qemu
which ofc produces the same error. This PR implements a simple rotation that will keep putting options on the back of the arguments until finished.Needless to say that
apt install qemu -t bookworm-backports
works already without this modification.I did notice this:
So it could be by design. But in that case, just throw an error if the first argument is not a valid command?