CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2QdxY4RzWzUUiLuE at potatochowder.com 2QdxY4RzWzUUiLuE at potatochowder.com
Thu Oct 15 20:15:21 EDT 2020


On 2020-10-16 at 10:59:16 +1100,
Samuel Marks <samuelmarks at gmail.com> wrote:

> --optimizer Adam,learning_rate=0.01,something_else=3
> 
> That syntax isn’t so bad! =]
> 
> How would you suggest the help text for this looks? (don’t worry about
> implementation, just what goes to stdout/stderr)

    --optimizer name[,option=value...]

Obviously, you'll have to explain that the brackets and the words option
and value are meta syntax, but you're probably already doing that for
your current meta syntax anyway.


More information about the Python-list mailing list