992: Update wapm-cli to latest version r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

This PR:
* [x] Updates WAPM version to 0.4.1
* [x] Fixes arguments issue introduced in #990

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
This commit is contained in:
bors[bot] 2019-11-21 01:32:51 +00:00 committed by GitHub
commit 9e144c623b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 4 deletions

View File

@ -2,6 +2,7 @@
## **[Unreleased]**
- [#992](https://github.com/wasmerio/wasmer/pull/992) Updates WAPM version to 0.4.1, fix arguments issue introduced in #990
- [#990](https://github.com/wasmerio/wasmer/pull/990) Default wasmer CLI to `run`. Wasmer will now attempt to parse unrecognized command line options as if they were applied to the run command: `wasmer mywasm.wasm --dir=.` now works!
- [#987](https://github.com/wasmerio/wasmer/pull/987) Fix `runtime-c-api` header files when compiled by gnuc.

View File

@ -18,7 +18,7 @@ use std::process::exit;
use std::str::FromStr;
use std::collections::HashMap;
use structopt::StructOpt;
use structopt::{clap, StructOpt};
use wasmer::*;
use wasmer_clif_backend::CraneliftCompiler;
@ -848,8 +848,19 @@ fn get_compiler_by_backend(backend: Backend) -> Option<Box<dyn Compiler>> {
}
fn main() {
let options = CLIOptions::from_iter_safe(env::args())
.unwrap_or_else(|_| CLIOptions::Run(Run::from_args()));
// We try to run wasmer with the normal arguments.
// Eg. `wasmer <SUBCOMMAND>`
// In case that fails, we fallback trying the Run subcommand directly.
// Eg. `wasmer myfile.wasm --dir=.`
let options = CLIOptions::from_iter_safe(env::args()).unwrap_or_else(|e| {
match e.kind {
// This fixes a issue that:
// 1. Shows the version twice when doing `wasmer -V`
// 2. Shows the run help (instead of normal help) when doing `wasmer --help`
clap::ErrorKind::VersionDisplayed | clap::ErrorKind::HelpDisplayed => e.exit(),
_ => CLIOptions::Run(Run::from_args()),
}
});
match options {
CLIOptions::Run(options) => run(options),
#[cfg(not(target_os = "windows"))]

@ -1 +1 @@
Subproject commit c2da5cda3b8f9cf7dcea144f8cabdf342f38a0bf
Subproject commit 3562d6dda52df526e6e1917dd33bb2454917ab9c