mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 06:15:33 +00:00
Allow to do wasmer execution without the run
argument
This commit is contained in:
parent
3d3636059a
commit
1685455eb6
@ -842,7 +842,20 @@ fn get_compiler_by_backend(backend: Backend) -> Option<Box<dyn Compiler>> {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let options = CLIOptions::from_args();
|
||||
let options = {
|
||||
let args: Vec<String> = env::args().into_iter().filter(|x| !x.starts_with("-")).collect();
|
||||
match args.get(1).map_or("", |s| &s) {
|
||||
// Default
|
||||
"run" | "cache" | "validate" | "self_update" | "" => {
|
||||
CLIOptions::from_args()
|
||||
}
|
||||
// Wasmer trying to run a file directly
|
||||
_ => {
|
||||
let run_options = Run::from_args();
|
||||
CLIOptions::Run(run_options)
|
||||
}
|
||||
}
|
||||
};
|
||||
match options {
|
||||
CLIOptions::Run(options) => run(options),
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
|
Loading…
Reference in New Issue
Block a user