CadQuery / cq-cli

Command Line Interface for executing CadQuery scripts and converting their output to another format.
Apache License 2.0
21 stars 7 forks source link

Exception when passing a string parameter #28

Closed drayde closed 9 months ago

drayde commented 9 months ago

When I try passing a string parameter, an exception is raised, e.g. when I run cq-cli with the cube_params example:

python main.py --codec stl --outfile test.stl --infile ./tests/testdata/cube_params.py --outputopts width:2;tag_name:test;centered:True

Traceback (most recent call last): File "C:\WORK\nimble\cq-cli\src\cq_cli\main.py", line 487, in main() File "C:\WORK\nimble\cq-cli\src\cq_cli\main.py", line 424, in main op = int(opt_parts[1]) ^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: 'test'

jmwright commented 9 months ago

You have to quote the outputopts. See examples 7 and 8 in the readme.

drayde commented 9 months ago

I tried that, it doesn't make a difference.

jmwright commented 9 months ago

@drayde Please have a look at PR #31 and see if you think it solves this issue properly. The user can now use a single quote (') or escaped double quote (\") to specify a string parameter.

drayde commented 9 months ago

Yes, thanks, that should do the trick