in reply to Re^2: Closed:how to argparse same option to array instead of overwrite
in thread Closed:how to argparse same option to array instead of overwrite

Ah, I misread. You are completely misusing options. You should provide a better interface.

  • Comment on Re^3: Closed:how to argparse same option to array instead of overwrite

Replies are listed 'Best First'.
Re^4: Closed:how to argparse same option to array instead of overwrite
by vincentaxhe (Scribe) on Jul 10, 2024 at 04:46 UTC
    English is not my native language, and my code is not buggy, it works just like normal argparser do and deal with filenames start with '-', the logic is subtle.

      I spotted at least one serious bug, and one missing important feature. But the comment to which you replied makes no mention of that??? It says the interface you are trying to provide is poor.

Re^4: Closed:how to argparse same option to array instead of overwrite
by NERDVANA (Priest) on Jul 10, 2024 at 05:43 UTC
    So you hate ffmpeg then?
        ffmpeg is one of many tools I've come across over the years where the order of the options is important. ffmpeg can combine multiple inputs, each can have filters or format conversions applied, and then there can be multiple output codecs each of which has its own parameters. The parameters "queue up" so that options applying to inputs collect until the next '-i' option, where they get applied to that input. You can then specify completely different values for the same options before the next '-i'.

        To be fair, I actually don't like the interface that much myself, because I can't remember the details and need to consult the manual each time. But, I assume that someone who does lots of video encoding could remember the details and be quite happy with it.

        I was being a bit flippant, but my point is that you are judging his interface as defective without even knowing what problem it's solving. There are certainly times when a "script of commands" can comfortably be arranged in the arguments of a command line tool. The next larger alternative is to create a custom scripting language for the problem, or make it into an API that can be used by a full-fledged scripting language. Sometimes that seems like overkill for the size of problem the tool is meant to solve.