-
Notifications
You must be signed in to change notification settings - Fork 824
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
Added invoke option to the command #968
Conversation
Why invoke and not |
@@ -132,6 +132,10 @@ struct Run { | |||
)] | |||
backend: Backend, | |||
|
|||
/// Invoke a specified function |
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.
Maybe "specify the name of the start function" or "of the main function" of something like that?
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.
Is not a main function, but a raw function that you might want to invoke.
It would be nice if this could take integer parameters like --invoke fun_name 2,3,4 ... this was also previously suggested to be a separate command |
It's not an entry function. But a function that you might want to call it alone. In general I'm following the naming of other implementations
Right now it will take the arguments provided in the CLI (transformed to the necessary i32, i64, ... values). Such as: wasmer run myfile.wasm --invoke fun 1 2 3 |
@@ -132,6 +132,10 @@ struct Run { | |||
)] | |||
backend: Backend, | |||
|
|||
/// Invoke a specified function | |||
#[structopt(long = "invoke", short = "i")] | |||
invoke: Option<String>, |
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.
⛳️
Consider:
#[structopt(long = "invoke", short = "i", default = "main")]
invoke: String
This is less flexible, but for the code as it is now, this is a cleaner solution
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 don't like that much, because depending on the integration you use (emscripten, wasi, ...) the default might vary. Will go through the other approach
This reverts commit f3b7c6b.
bors r+ |
968: Added invoke option to the command r=syrusakbary a=syrusakbary # Description This PR adds an `--invoke` to the Wasmer CLI <!-- Provide details regarding the change including motivation, links to related issues, and the context of the PR. --> # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Syrus <[email protected]>
Build succeeded
|
Description
This PR adds an
--invoke
to the Wasmer CLIReview