Skip to content

Commit

Permalink
Simplify default run logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark McCaskey committed Nov 20, 2019
1 parent 1685455 commit ec285d7
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/bin/wasmer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -843,14 +843,9 @@ fn get_compiler_by_backend(backend: Backend) -> Option<Box<dyn Compiler>> {

fn main() {
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
_ => {
match StructOpt::from_iter_safe(env::args()) {
Ok(options) => options,
Err(_) => {
let run_options = Run::from_args();
CLIOptions::Run(run_options)
}
Expand Down

0 comments on commit ec285d7

Please sign in to comment.