On 16Oct2020 10:09, Samuel Marks <samuelma...@gmail.com> wrote:
>Yes it’s my module, and I’ve been using argparse
>https://github.com/SamuelMarks/ml-params
>
>No library I’ve found provides a solution to CLI argument parsing for my
>use-case.
>
>So I’ll write one. But what should it look like, syntactically and
>semantically?

I would make it look like argparse, if you're using argparse already. 
Can argparse be subclassed, eg to override some internal 
option-gathering method?

In particular, I would not invent yet another command line syntax.

I'd stick with the common -a and --long-name style, maybe using the -{ -} 
stuff you cited from nginx if it meets your needs. As with any 
bracketing syntax, you may one day find yourself needing to embed the 
literal end-bracket symbol in your command line one day, and thus may 
need some kind of escaping notion ("no! not closing the brackets yet!").

I can't offer mch specific advice on argparse, I use getopt myself.

Cheers,
Cameron Simpson <c...@cskk.id.au>
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to