-
Notifications
You must be signed in to change notification settings - Fork 375
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
feat: allow Args on main run #982
Conversation
var Args []string | ||
|
||
func init() { | ||
Args = runtime_args() | ||
} | ||
|
||
func runtime_args() []string // in package runtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried two possible solutions:
- Directly inject os.Args values when calling RunMain function on the VM. Problem:
os
package is not available by default on the VM, you need VMKeeper for it. - Implementing
runtime_args
function somehow, returning the provided arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second option.
I suggest: VMKeeper to be the preferred "frontend" for configuring the VM for advanced use cases like full context, multi-transaction features etc, while the raw gno.Machine remains suitable for single-test focused tasks.
Related with #1016.
After #1016 will be finished, I plan to migrate most of the gno
CLI to it instead of gno.Machine
, especially the REPL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
Closing this PR because it was just opened to get some feedback from @moul . More context here: #982 (comment) |
Attempt to implement Args on main() runs.
Problem: I didn't find a clean way to inject os.Args values.
Contributors Checklist
BREAKING CHANGE: xxx
message was included in the description