effekt icon indicating copy to clipboard operation
effekt copied to clipboard

Passing same `--no-...` option twice breaks with bad error message

Open marzipankaiser opened this issue 9 months ago • 1 comments

When running effekt indirectly via a script, it can happen that options like --no-optimize get duplicated, e.g.:

effekt --no-optimize --no-optimize <some effect file>

When this happens, Effekt currently errors out with:

Command-line error: Bad arguments for option 'optimize': ' ' - wrong arguments format
 Common Options
  -c, --compile                  Compile the Effekt program to the backend
                                 specific representation
      --no-compile
...

IMHO this should just work, or at least provide a better error message.

marzipankaiser avatar Mar 17 '25 16:03 marzipankaiser

This seems to be a problem in the Scallop library. It seems that toggle options don't like to see other toggle options: https://github.com/scallop/scallop/blob/0f290269a69e22068629294c864ad2bd9a2c3ff1/src/main/scala/org.rogach.scallop/CliOptions.scala#L263-L278

mlutze avatar Mar 28 '25 13:03 mlutze