Following command (notice order):
eyeD3 --text-frame='TRCK:' --track=5 file.mp3
Leaves "track" not at "5":
... Setting track info: (5, None) Removing TRCK text frame
Please intrepret the options in the order given. The options for the command line are composed in a script in assuming a standard unix pretense where later options always take precedence over previous ones.
An idea for implementation:
LIST = reverse OPTIONS while LIST OPT = shift LIST LIST_DUPLICATES = grep OPT in LIST delete LIST_DUPLICATES from LIST <also search for similar OPTIOS, like TRCK == --track> done OPTIONS = reverse LIST # restores original order
What should be left are unique options. Unnecessary work is also reduced (file operations)
Of couldse the code is a little bit more involved because one OPT is not necessarily a single word (--opt=value vc. --opt value) that can be reversed that easily.
Working LIST backwards could also work.