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

Implement command: zigup run #52

Merged
merged 3 commits into from
Mar 28, 2022
Merged

Conversation

iddev5
Copy link
Contributor

@iddev5 iddev5 commented Mar 27, 2022

Implements the command with the signature zigup run <version> <args>... or zigup run <version> -- <args>

This PR implements the concept of positional arguments into zigup. This is because commands like zigup run 0.8.1 --help for example, would run --help command of zigup as opposed to zig 0.8.1, so the solution was to use positional arguments to reliably pass arguments into the compiler

Doesn't work for zigup run master

Closes #23

Open question:

  1. Should master be allowed? If so then same way as zigup default?
  2. Is this way to pass args ok? The other solution is to pass all the arguments as a single string, that should be simple to implement, as per desired.

@marler8997
Copy link
Owner

I think on the initial implementation we can leave out the positional argument logic. If it becomes an issue then we can address it.

@marler8997
Copy link
Owner

marler8997 commented Mar 27, 2022

I realize I should maybe clarify what I'm looking for here.

In the argument parsing loop, we should add a special case that checks whether the first non-option argument is "run". If that's the case, we stop argument parsing and immediately call a function that implements the "run" command with the rest of the arguments.

P.S. Should master be allowed? Not sure, I'm fine leaving it for later though.

zigup.zig Show resolved Hide resolved
@iddev5
Copy link
Contributor Author

iddev5 commented Mar 27, 2022

Its done. To be honest, I didn't implemented it in terms of this in the first place because it felt hackish to me, and that such a special case would not work in case of a real argument parser, and thus be a bit counter-techincal. But its okay, it works.

Leaving master for now.

zigup.zig Outdated Show resolved Hide resolved
@iddev5 iddev5 force-pushed the ay-zigup-run branch 3 times, most recently from 824e119 to ca7394e Compare March 28, 2022 07:27
@marler8997 marler8997 merged commit 9cb83cb into marler8997:master Mar 28, 2022
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 this pull request may close these issues.

zigup run VERSION command?
2 participants