Skip to content
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

Allow colons in Windows host paths #235

Merged
merged 1 commit into from
Aug 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/WASI-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ links as well.
command-line option:

```
$ wasmtime --dir=. --mapdir=/tmp:/var/tmp demo.wasm test.txt /tmp/somewhere.txt
$ wasmtime --dir=. --mapdir=/tmp::/var/tmp demo.wasm test.txt /tmp/somewhere.txt
$ cat /var/tmp/somewhere.txt
hello world
```
Expand Down
6 changes: 3 additions & 3 deletions src/wasmtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Options:
--preload=<wasm> load an additional wasm module before loading the main module
--env=<env> pass an environment variable (\"key=value\") to the program
--dir=<dir> grant access to the given host directory
--mapdir=<mapping> where <mapping> has the form <wasmdir>:<hostdir>, grant access to
--mapdir=<mapping> where <mapping> has the form <wasmdir>::<hostdir>, grant access to
the given host directory with the given wasm directory name
-h, --help print this help message
--version print the Cranelift version
Expand Down Expand Up @@ -135,9 +135,9 @@ fn compute_preopen_dirs(flag_dir: &[String], flag_mapdir: &[String]) -> Vec<(Str
}

for mapdir in flag_mapdir {
let parts: Vec<&str> = mapdir.split(':').collect();
let parts: Vec<&str> = mapdir.split("::").collect();
if parts.len() != 2 {
println!("--mapdir argument must contain exactly one colon, separating a guest directory name and a host directory name");
println!("--mapdir argument must contain exactly one double colon ('::'), separating a guest directory name and a host directory name");
exit(1);
}
let (key, value) = (parts[0], parts[1]);
Expand Down