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

Add a way to pass arguments to the nim compiler from the command line #17

Open
AngelEzquerra opened this issue Mar 8, 2022 · 0 comments

Comments

@AngelEzquerra
Copy link

I recently tried to run the example of the nim-neel repo (https://github.com/Niminem/Neel) using nimcr. This failed because the nim-neel example requires you to pass --threads:on (and it also recommends passing --app:gui as well).

Currently you must edit the script to customize the arguments that are passed to the nim compiler. Thus I had to edit the example to make it work with nimcr. While this makes sense in many cases, it can also be a bit inconvenient like in this case. Another example would be if you wanted to switch between release and debug modes. It would thus be great if there was a way to pass arguments to the nim compiler through the command line as well.

One potential solution would be to let the user specify a ---nimcr-args (or perhaps --nim) argument that would be a string with the arguments that would be passed to the nim compiler. Another solution would be to assume any arguments starting with "-" and passed before the nim filename are meant for the nim compiler. That way you could do:

nimcr -d:debug my_nim_file.nim --my --script arguments

For extra safetly nimcr could check if any of those arguments is an existing file (in case there is someone crazy enough to want to run a script called "-d:debug".

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