Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when passing a string parameter #28

Closed
drayde opened this issue Feb 9, 2024 · 4 comments · Fixed by #31
Closed

Exception when passing a string parameter #28

drayde opened this issue Feb 9, 2024 · 4 comments · Fixed by #31

Comments

@drayde
Copy link
Contributor

drayde commented Feb 9, 2024

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
Copy link
Member

jmwright commented Feb 9, 2024

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

@drayde
Copy link
Contributor Author

drayde commented Feb 9, 2024

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

@jmwright
Copy link
Member

@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
Copy link
Contributor Author

drayde commented Feb 10, 2024

Yes, thanks, that should do the trick

@drayde drayde closed this as completed Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants