CadQuery / cq-cli

Command Line Interface for executing CadQuery scripts and converting their output to another format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception when passing a string parameter

drayde opened this issue · comments

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'

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

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

@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.

Yes, thanks, that should do the trick