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

Respecting Quotes in Custom Generator Command #3

Open
GCHQDeveloper560 opened this issue Oct 14, 2020 · 0 comments
Open

Respecting Quotes in Custom Generator Command #3

GCHQDeveloper560 opened this issue Oct 14, 2020 · 0 comments

Comments

@GCHQDeveloper560
Copy link
Contributor

I'm experimenting with Chisel and FuseSoC. Using the Chisel template Verilog can be generated with a command like

sbt 'runMain gcd.GCD'

Note that it appears sbt wants all of its arguments as a single string.

Rather than jumping into a special sbt or Chisel generator I attempted to use the custom generator to run the above command. The list passed to the subprocess call should be ['sbt', 'runMain gcd.GCD']. However, the string split command used in the custom generator doesn't respect quotes and produces ['sbt', "'runMain", "gcd.GCD'"]. It appears that shlex.split handles quotes as I would expect

>>> cmd="sbt 'runMain gcd.GCD'"
>>> cmd.split()
['sbt', "'runMain", "gcd.GCD'"]
>>> import shlex
>>> shlex.split(cmd)
['sbt', 'runMain gcd.GCD']

II've not found a way of escaping quotes or the like that will work with the string split method, but am certainly open to suggestions. Would it make sense to change the split command used in the custom generator, or is this likely to cause too many compatibility issues?

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

No branches or pull requests

1 participant