0.7.10-final: options are not interpreted in order given

Issue #119 new
Jari Aalto
created an issue

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
     delete LIST_DUPLICATES  from LIST
     <also search for similar OPTIOS, like TRCK == --track>

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.

Comments (3)

  1. Travis Shirk repo owner

    I'll look into this to make sure eyeD3 logically processes args in a sane order, but as far as absolute order.. that is not something python 'argparse' supports this likely won't happen.

  2. Log in to comment